luci: Index | Files

package fixflagpos

import ""


Package Files


func Fix Uses

func Fix(args []string) []string

Fix rearranges an `args []string` command line to enable positional arguments to be allowed before flag arguments, which makes some invocations look more natural.

Converts [pos1 pos2 -flag value pos3] into [-flag value pos3 pos1 pos2].

func FixSubcommands Uses

func FixSubcommands(args []string) []string

FixSubcommands is like Fix, except the first positional argument is understood as a subcommand name and it is not moved.

Converts [pos1 pos2 -flag value pos3] into [pos1 -flag value pos3 pos2].

Taking cipd as an example, compare:

* Default: cipd set-ref -ref=abc -version=def package/name
* Improved: cipd set-ref package/name -ref=abc -version=def

Much better.

Package fixflagpos imports 1 packages (graph) and is imported by 18 packages. Updated 2021-01-17. Refresh now. Tools for package owners.