Skip to content

Names of some commands are confusing #408

Closed

Description

@sophiajt

We're seeing a decent amount of confusion around some of the commands. I'll let this be the current list:

  • from-* and to-*: these are the worst offenders so far. People are regularly confusing one for the other
  • open: this already is a command on macOS, which is confusing

Activity

  1. wycats commented on Aug 26, 2019

    @wycats
    Contributor

    For from-* and to-*, how about changing to parse-json and to-json?

    I'm not sure what to do about open, because it really is a pretty great name. In fact, Ruby has an open that works with URLs and files just like our open

  2. andrasio commented on Aug 26, 2019

    @andrasio
    Member

    How can we ensure someone looking at [parse/from]-x or to-x knows exactly what inputs are expected? I see the confusion coming from the inputs expectations as well since it's different from what most people are used to, meaning a string or structured data.

    I think we should add more documentation and examples and see how it plays out.

    parse-json tells me (from a programmer perspective) is ideal for strings as input (which is the behavior), what about a sys admininistrator? What about as-json? (json --read|--out)?

    I think we should stick with open since so far the comments have been mostly for opening URL's, apps, and the Finder under macOS (and the majority of the time shell users work with files within the terminal)

  3. wycats commented on Aug 26, 2019

    @wycats
    Contributor

    What about as-json? (json --read|--out)?

    In general, I'm holding back from doing command overloads like that because our signature support is limited at the moment. That said, if you need very significant overloads to accomplish something, it might end up being confusing anyway or causing other problems.

    Can you elaborate what you're worried about with parse?

  4. twe4ked commented on Aug 26, 2019

    @twe4ked
    Contributor

    size was another one conflicting with a MacOS command. count was suggested, shall we go with that?

  5. andrasio commented on Aug 26, 2019

    @andrasio
    Member

    What about as-json? (json --read|--out)?

    In general, I'm holding back from doing command overloads like that because our signature support is limited at the moment. That said, if you need very significant overloads to accomplish something, it might end up being confusing anyway or causing other problems.

    I agree and it's something I would like to definitively avoid too.

    Can you elaborate what you're worried about with parse?

    No worries. I do like more the idea of naming things differently out of the usuals we see everywhere. parse is perfectly fine.

    I still believe we could wait more and see what feedback we get, provided we have more documentation and examples in place.

  6. sophiajt commented on Aug 26, 2019

    @sophiajt
    ContributorAuthor

    @twe4ked - something like that could work. Is string-stats too long, I wonder. count by itself seems like you're counting rows but maybe there's something we could add to make it more obvious.

    We could also consider making it part of the str command (cc @androbtech)

  7. kuchta commented on Aug 27, 2019

    @kuchta

    I suggest we use either read for open and write for save or load for open and store for save. Although write is historically used to message another user on the same unix system, I suppose it's not heavily used these days...

  8. added
    deprecated:question
    on May 16, 2020
  9. thegedge commented on May 16, 2020

    @thegedge
    Contributor

    This one is pretty old, so the names have settled for some time and I think with our current momentum and user base it would be a huge hit to have things change. We now have

    1. from <format> and to <format>
    2. open is still the same, but we have start to mimic the "open" command in OSX.

    We also have aliases, so we should make it possible basically rename everything.

  10. pohl commented on May 16, 2022

    @pohl

    New user here, giving nu a test-drive on MacOS, and I was disappointed by this issue being closed.

    ...but we have start to mimic the "open" command in OSX.

    I could not find a way to get start to work. Did this regress, or is there some documentation somewhere?

  11. DuncanHills commented on Jun 17, 2022

    @DuncanHills

    exact same experience as @pohl

  12. ksandvik commented on Aug 10, 2022

    @ksandvik

    Yes, open in nu-shell should be changed, open cli command has been in MacOSX since the very early days and this will just cause confusion and frustration.

    Or then a way to rename nu shell commands so I could map 'open' or 'read' or 'load'.

  13. hyiltiz commented on Sep 2, 2022

    @hyiltiz
    Contributor

    Masking macOS's open was unexpected; it was not straightforward to get it back and it is used by macOS users frequently (speaking for myself and friends). read/write sounds awesome.

    as json is confusing; does it mean parse an input string as json, or treat (by converting) an input data table as json? to and from are great; we just need to better document their help and error messages.

  14. connormcmk commented on Nov 11, 2022

    @connormcmk

    +1 for read / write and +1 for neither ^open nor start working for me.

    Also, a copy to clipboard command would be cool. Like version | to md | clipboard

    version branch commit_hash build_os build_target rust_version cargo_version pkg_version build_time build_rust_channel features installed_plugins
    0.69.1 macos-aarch64 aarch64-apple-darwin rustc 1.64.0 cargo 1.64.0 (387270bc7 2022-09-16) 0.69.1 2022-09-28 02:48:01 +00:00 release database, dataframe, default, trash, which, zip
  15. lgarron commented on May 26, 2023

    @lgarron

    I just tried nu shell (at the recommendation of No Boilerplate) and was also immediately disappointed to find that nu conflicts with the built-in open command on macOS. It caused an error for literally the first thing I tried to do:

    ~> open -R $nu.env-path                        05/25/2023 09:43:53 PM
    Error: nu::parser::unknown_flag
    
      × The `open` command doesn't have flag `-R`.
       ╭─[entry #11:1:1]
     1 │ open -R $nu.env-path
       ·       ┬
       ·       ╰── unknown flag
       ╰────
      help: Available flags: --help(-h), --raw(-r). Use `--help` for
            more information.
    

    I'll try workarounds, but this is an unfortunate first experience on macOS.

  16. amtoine commented on May 26, 2023

    @amtoine
    Member

    @lgarron 👋

    we have a section in the Nushell book about this problem 👍
    this will

    • redefine open as the built-in open you're used to on MacOS
    • define a nuopen command that does the same as Nushell's built-in open

    😌

  17. lgarron commented on May 26, 2023

    @lgarron

    @lgarron 👋

    we have a section in the Nushell book about this problem 👍 this will

    • redefine open as the built-in open you're used to on MacOS
    • define a nuopen command that does the same as Nushell's built-in open

    😌

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    deprecated:question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions