Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List of input file types shown to user is incomplete #92

Open
x0rloser opened this issue May 8, 2020 · 2 comments
Open

List of input file types shown to user is incomplete #92

x0rloser opened this issue May 8, 2020 · 2 comments

Comments

@x0rloser
Copy link

x0rloser commented May 8, 2020

The usage info for the tool does not show all supported input file types. So unless the user looks at the sourcecode they might not realise there are other types that are supported. I came across this issue trying to access a save file, but there was no "save" filetype listed in usage so couldnt work out what i was doing wrong until i looked at the sourcecode.

So need to make this usage:

  -t, --intype=type  Specify input file type [nca, xci, pfs0, romfs, hfs0, npdm, pk11, pk21, ini1, kip1, nax0, keygen]

match these available options

            case 't':
                if (!strcmp(optarg, "nca")) {
                    nca_ctx.tool_ctx->file_type = FILETYPE_NCA;
                } else if (!strcmp(optarg, "pfs0") || !strcmp(optarg, "exefs")) {
                    nca_ctx.tool_ctx->file_type = FILETYPE_PFS0;
                } else if (!strcmp(optarg, "romfs")) {
                    nca_ctx.tool_ctx->file_type = FILETYPE_ROMFS;
                } else if (!strcmp(optarg, "nca0_romfs") || !strcmp(optarg, "nca0romfs") || !strcmp(optarg, "betaromfs") || !strcmp(optarg, "beta_romfs")) {
                    nca_ctx.tool_ctx->file_type = FILETYPE_NCA0_ROMFS;
                } else if (!strcmp(optarg, "hfs0")) {
                    nca_ctx.tool_ctx->file_type = FILETYPE_HFS0;
                } else if (!strcmp(optarg, "xci") || !strcmp(optarg, "gamecard") || !strcmp(optarg, "gc")) {
                    nca_ctx.tool_ctx->file_type = FILETYPE_XCI;
                } else if (!strcmp(optarg, "npdm") || !strcmp(optarg, "meta")) {
                    nca_ctx.tool_ctx->file_type = FILETYPE_NPDM;
                } else if (!strcmp(optarg, "package1") || !strcmp(optarg, "pk11")) {
                    nca_ctx.tool_ctx->file_type = FILETYPE_PACKAGE1;
                } else if (!strcmp(optarg, "package2") || !strcmp(optarg, "pk21")) {
                    nca_ctx.tool_ctx->file_type = FILETYPE_PACKAGE2;
                } else if (!strcmp(optarg, "ini1")) {
                    nca_ctx.tool_ctx->file_type = FILETYPE_INI1;
                } else if (!strcmp(optarg, "kip1") || !strcmp(optarg, "kip")) {
                    nca_ctx.tool_ctx->file_type = FILETYPE_KIP1;
                } else if (!strcmp(optarg, "nso0") || !strcmp(optarg, "nso")) {
                    nca_ctx.tool_ctx->file_type = FILETYPE_NSO0;
                } else if (!strcmp(optarg, "nax0") || !strcmp(optarg, "nax")) {
                    nca_ctx.tool_ctx->file_type = FILETYPE_NAX0;
                } else if (!strcmp(optarg, "keygen") || !strcmp(optarg, "keys") || !strcmp(optarg, "boot0") || !strcmp(optarg, "boot")) {
                    nca_ctx.tool_ctx->file_type = FILETYPE_BOOT0;
                } else if (!strcmp(optarg, "save")) {
                    nca_ctx.tool_ctx->file_type = FILETYPE_SAVE;
                }
                break;

Since there are quite a few options for the intype parameter it might help to list them in usage in alphabetical order? Also group together the different intypes that are equivalent since users may not be aware they are the same thing.

The resulting usage is a lot longer, but since filetype is required to correctly perform any action it seems worthwhile.

So perhaps something like:

"  -t, --intype=type  Specify input file type\n"
"                     [hfs0, ini1, keygen/keys/boot0/boot, kip/kip1, nax/nax0,\n"
"                      nca, nca0romfs/nca0_romfs/betaromfs/beta_romfs, npdm/meta,\n"
"                      nso/nso0, package1/pk11, package2/pk21, pfs0/exefs, romfs,\n"
"                      save, xci/gamecard/gc]\n"
@shchmue
Copy link
Collaborator

shchmue commented May 8, 2020

this was addressed some time ago, just needs merge. it’s included in this PR #88

@x0rloser
Copy link
Author

x0rloser commented May 8, 2020

PR #88 only adds the "save" type.
Still missing after that are:

  • nca0romfs/nca0_romfs/betaromfs/beta_romfs
  • nso0

Also still missing is the inclusion of the equivalent types, such as: pfs0/exefs instead of just pfs0.
This would help n00bs like me who might not be aware that pfs0 and exefs are the same thing. This goes for all equivalencies, not just the pfs0 one I used as an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants