haxelib icon indicating copy to clipboard operation
haxelib copied to clipboard

Command specific flags / help command

Open ibilon opened this issue 9 years ago • 1 comments

@nadako in #318

though we don't really have any command-specific switches

Actually we have one: --flat: do not use --recursive cloning for git.

Install/update could use a --conservative flag to prevent downloading the latest version for a dependency if we currently have one that can be used. Proxy could have a --force to prevent the ping of google if you want to set it while offline. For set maybe a --last to easily switch to the latest. And I'm sure there are other flags that could be added/thought of.

I'm not saying that we should add a lot of options just for the fun of it, but there's the possibility for some useful features without making the needlessly global, which may be the reason that some weren't added.

This would require changes in the help command: (which would be good on its own) Available switches => Global switches and adding haxelib help command that would print the command arguments, flags and documentation.

Documentation should either be included from an external file, or have the website documentation be generated from the code, to keep both in sync. I think the first is better since it'd be automatic.

ibilon avatar Apr 09 '16 13:04 ibilon

It would also be useful to use option flags for the many options that can be passed into haxelib git, because sometimes you might want to specify the sub directory without specifying a custom branch, or a tag without a custom sub directory, but currently you have to pass all the previous ones in order to be able to pass in any of the later ones. Also, branch and tag should really be mutually exclusive.

So instead of: haxelib git [project-name] [git-clone-path] [branch] [subDir] [tag] haxelib hg [project-name] [mercurial-clone-path] [branch] [subDir] [revision]

Something like: haxelib git [project-name] [git-clone-path] [--branch <branch-name> | --tag <tag-name>] [--sub-dir <directory>] [--flat] haxelib hg [project-name] [mercurial-clone-path] [--branch <branch-name>] [--rev <revision>] [--sub-dir <directory>]

Also, perhaps for haxelib git the --branch option should have a name that better reflects its use, because it can either be a branch name or a commit hash.

tobil4sk avatar Nov 14 '21 16:11 tobil4sk