ugexe / zef

Raku Module Management
Artistic License 2.0
207 stars 44 forks source link

fetch 'Usage' message incorrectly suggests arguments are optional #518

Closed silentTeee closed 1 year ago

silentTeee commented 1 year ago

Context

Running zef fetch without any arguments gets the 'Usage' message, when the Usage message itself seems to indicate that all arguments are optional. If my understanding is correct, then fetch is supposed to be specifically for downloading source code, and if that's the case then it makes sense that not providing a module name would fail. But that's not what the Usage message indicates.

Expected Behavior

Running zef fetch shows the following:

user@local:~$ zef fetch
Usage:
  zef [--force|--force-fetch] [--timeout|--fetch-timeout[=Int]] [--degree|--fetch-degree[=Int]] [--update[=Any]] fetch <identities> ... -- Download specific distributions

Actual Behavior

user@local:~$ zef fetch
Usage:
  zef [--force|--force-fetch] [--timeout|--fetch-timeout[=Int]] [--degree|--fetch-degree[=Int]] [--update[=Any]] fetch [<identities> ...]
/change -- Download specific distributions

Steps to Reproduce

run zef fetch from any shell

Your Environment

user@local:~$ raku -v
Welcome to Rakudo™ v2023.05.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2023.05.
user@local:~$ zef list --installed
===> Found via inst#/opt/rakudo-pkg/share/perl6/core
rakudo:ver<2023.05>:auth<Yet Another Society>
===> Found via inst#/home/atsantilis/.raku
App::Rak:ver<0.2.17>:auth<zef:lizmat>
Backtrace::Files:ver<0.0.3>:auth<zef:lizmat>
CLI::Version:ver<0.0.8>:auth<zef:lizmat>
File::Find:ver<0.1.1>
File::Which:ver<1.0.4>
Git::Files:ver<0.0.6>:auth<zef:lizmat>
IO::Path::AutoDecompress:ver<0.0.2>:auth<zef:lizmat>
JSON::Fast::Hyper:ver<0.0.3>:auth<zef:lizmat>
JSON::Fast:ver<0.17>:auth<cpan:TIMOTIMO>
LibraryMake:ver<1.0.0>:auth<github:retupmoca>
META::constants:ver<0.0.3>:auth<zef:lizmat>
Shell::Command
String::Utils:ver<0.0.15>:auth<zef:lizmat>
String::Utils:ver<0.0.18>:auth<zef:lizmat>
Term::termios:auth<github:krunen>
Terminal::ANSIColor:ver<0.9>:auth<zef:lizmat>
Terminal::ANSIParser:ver<0.0.3>:auth<zef:japhb>
Terminal::LineEditor:ver<0.0.13>:auth<zef:japhb>
Text::MiscUtils:ver<0.0.7>:auth<zef:japhb>
Trap:ver<0.0.1>:auth<zef:lizmat>
as-cli-arguments:ver<0.0.7>:auth<zef:lizmat>
has-word:ver<0.0.3>:auth<zef:lizmat>
highlighter:ver<0.0.18>:auth<zef:lizmat>
hyperize:ver<0.0.2>:auth<zef:lizmat>
path-utils:ver<0.0.13>:auth<zef:lizmat>
paths:ver<10.0.9>:auth<zef:lizmat>
rak:ver<0.0.47>:auth<zef:lizmat>
zef:ver<0.18.2>:auth<github:ugexe>:api<0>
ugexe commented 1 year ago

My previous example had a typo. I'm not sure why the #| doesn't show up as zef just uses the default cli argument parsing. I suspect a smaller example could be figured out (that doesn't use zef) to report to Raku, but until then I'll reopen this.

ugexe commented 1 year ago

I think I was mistaken -- I cannot reproduce the example given in the original issue. At least regarding the missing "Download specific distributions" that you mention isn't showing up:

$ raku -I. bin/zef fetch
Usage:
  bin/zef [--force|--force-fetch] [--timeout|--fetch-timeout[=Int]] [--degree|--fetch-degree[=Int]] [--update[=Any]] fetch [<identities> ...] -- Download specific distributions

$ zef fetch
Usage:
  zef [--force|--force-fetch] [--timeout|--fetch-timeout[=Int]] [--degree|--fetch-degree[=Int]] [--update[=Any]] fetch [<identities> ...] -- Download specific distributions

as for fetch <identities> vs fetch [<identities> ...], that would indeed still be a rakudo issue as zef declares that parameter as requiring at least one value via *@identities ($, *@).

If you think there is still a zef issue here that I haven't addressed, please feel free to reopen.