What do you think about this kind of indication for conflicting or otherwise invalid arguments?

With command line arguments being 1D and line length valid up to hundreds of kilobytes only inline indication seems to work.

Would you change anything?

  • Aloso@lemmyrs.org
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    You need to tell the user that this is an error, otherwise they don’t know if it succeeded or not.

    error: --att cannot be used at the same time as --intel

    The last line is incomprehensible, just use a full sentence.

    • manpacket@lemmyrs.orgOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

      You need to tell the user that this is an error, otherwise they don’t know if it succeeded or not.

      So add “Error:” at the beginning? Looks a bit better, right.

      Last line is more or less copy of the command line user gave with markers indicating bits parser does not like.

      • ActuallyRuben@actuallyruben.nl
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        I’d recommend adding the markers on a line below the text, in a similar way to how rust compiler output indicates errors.

        Also WIN isn’t really clear to me what it’s supposed to mean, does it mean that flag “wins” and takes precedence over the other conflicting flag? Does that even matter if the program exits with an error anyway?