ebcrowder / rust_ledger

Rust implementation of ledger, the command line accounting tool.
GNU General Public License v3.0
137 stars 19 forks source link

bugfix: don't panic wihout command #17

Closed dshemin closed 4 years ago

dshemin commented 4 years ago

Hi! I think it will be better to see help message instead of panic when you forgot to specify command. After this fix you will see something like that:

$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.12s
     Running `target/debug/rust_ledger`
rust_ledger 0.4.3
Eric Crowder <eric@ebcrowder.dev>

USAGE:
    rust_ledger [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    account     account module
    balance     balance module
    csv         csv module
    help        Prints this message or the help of the given subcommand(s)
    register    register module
$ 
dshemin commented 4 years ago

I saw this macro in one library. I'm new in Rust :)