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

command line help messages are self contradictory about the position of the --data-dir option #115

Open
LilithHafner opened this issue Aug 9, 2023 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@LilithHafner
Copy link
Contributor

elfshaker --help indicates options must precede subcommands while the hint displayed by elfshaker store indicates that --data-dir must be specified after the subcommand.

IIUC, elfshaker is entirely agnostic about command line argument order. For example elfshaker store --data-dir dir name --verbose works even though the arguments are not in an order that is documented to work. In this case, I think it is okay for the documentation to either mention agnosticism to argument order or simply document a consistent usage, but to document two mutually inconsistent usages without mention of agnosticism to argument order is not ideal.

MWE
x@x elfshaker % ./target/release/elfshaker --help          
elfshaker 

USAGE:
    elfshaker [FLAGS] [OPTIONS] [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information
        --verbose    Enables verbose description of the execution process.

OPTIONS:
        --data-dir <data_dir>    Set the path to the elfshaker repository. [env: ELFSHAKER_DATA]  [default:
                                 elfshaker_data]

SUBCOMMANDS:
    clone         Clones a remote repository into a new directory
    extract       Can be used to extract a snapshot.
    find          Searches the repository index.
    gc            Cleanup redundant snapshots and unreferenced objects. This frees up disk space after creating a
                  pack.
    help          Prints this message or the help of the given subcommand(s)
    list          Prints the list of snapshots available in the repository.
    list-files    Prints the list of files available in the snapshot.
    list-packs    Prints the list of packs available in the repository.
    pack          Packs the given snapshots into a pack file.
    show          Shows the contents of the files in the snapshot.
    store         Stores the current state of the repository in a snapshot. The snapshots created in this way can
                  later be packed in a .pack file using the pack command.
    update        Updates the remote indexes.
x@x elfshaker % ./target/release/elfshaker store 
error: The following required arguments were not provided:
    <snapshot>

USAGE:
    elfshaker store <snapshot> --data-dir <data_dir>

For more information try --help
x@x elfshaker % ./target/release/elfshaker store --data-dir dir name --verbose
[INFO (main) 67.219875ms]: Opening repository...
[INFO (main) 68.2505ms]: Opening repository took 399.042µs
[INFO (main) 168.064333ms]: Computing checksums for 1687 files...
@peterwaller-arm peterwaller-arm added the help wanted Extra attention is needed label Aug 9, 2023
@peterwaller-arm
Copy link
Contributor

I agree with what you're saying, sounds good to me, pull requests welcomed to improve the situation.

@peterwaller-arm
Copy link
Contributor

(Thanks for your other contributions, and welcome! Beware I may be slow to respond over the coming month with various holidays and whatnot happening)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants