Page MenuHomePhabricator

toolforge-rs: Use proper argument parsing for toolforge-tunnel CLI
Closed, ResolvedPublic

Description

See https://gitlab.wikimedia.org/repos/mwbot-rs/toolforge/-/blob/main/src/bin/cli.rs. Instead of reading the first argument on the CLI, we should use proper argument parsing from the clap crate. If you're not familiar with it, clap has its own tutorials/guides.

There are two ways to call the tool, first with no arguments:

toolforge-tunnel

which invokes the all_slices() code path.

Then with a single argument:

toolforge-tunnel enwiki

which calls tunnel() with just that database name.

clap should automatically add a help option, so that toolforge-tunnel -h prints out usage documentation.

Note that during development you can invoke the command with cargo run.

Details

TitleReferenceAuthorSource BranchDest Branch
Use `clap` for argument parsingrepos/mwbot-rs/toolforge!6milkydeferclapmain
Customize query in GitLab