Giter Club home page Giter Club logo

Comments (6)

technocake avatar technocake commented on June 2, 2024 1
  1. change flag in the_real_goto.py from -f to -o, --open and open
  2. update start_goto in _goto_completions to use -o, --open and open instead of -f
  3. update usage() to document this usage in the_real_goto.py

To do 2. simply append these new flags to the chain of || statements.

from goto.

Arxcis avatar Arxcis commented on June 2, 2024 1

I want to do this as part of a bigger change where I try to use something like the Click library for command line parsing.

from goto.

Arxcis avatar Arxcis commented on June 2, 2024

I now realize that this issue is closely related to #4.
I think that the default mode should be cd and then there could be a -ofor explorer.
Since goto is a command-line tool, cd - ing is what i except to be the default behaviour.

My humble API suggestion

goto <magicword>            # cd to folder
goto <magicword> -o --open  # open window

I am not 100% sure if it is a good idea to do both cd to folder + open window, but in many case it would be useful. Some people might find it annoying. Maybe a third option would be cool

goto <magicword>                 # cd
goto <magicword> -o --open       # open
goto <magicword> --ocd           # cd + open  (lol ocd)

from goto.

technocake avatar technocake commented on June 2, 2024

This was just merged in on from branch #17 -- you now can just do goto <magicword>
however, the flag for opening window is -f

That flag could possible be associated with "force" rm -rf | git push origin master -f etc.

So your flag, -o is better. How about the word: open also?

goto open <magicword>
goto <magicword> -o
goto <magicword> --open

I will actually leave the job of the better flags and word to @Arxcis this time ^^ (if he takes the challenge)

from goto.

technocake avatar technocake commented on June 2, 2024

For now I implemented it in the brute way the parsing is now,

Will check out Click and see how it is to work with compared to argparse

from goto.

technocake avatar technocake commented on June 2, 2024

Let's roll with Click πŸ‘

from goto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.