Code Monkey home page Code Monkey logo

adhocsh's People

Contributors

8ware avatar

Watchers

 avatar  avatar

adhocsh's Issues

Restructure Project Fitting Python Packages

To distribute and install adhocsh more easily the project should be restructured to fit the typical Python package structure. This includes a Python module and a script using the module which both can be installed via pip using an appropriate setup.py. Testability will be increased as well.

Allow Parameters for Default Command

Many sub-commands accept parameters to change their behavior, e.g. git status . or git log --name-status. Allow to parameterize the default command.

Persist Command History

Inbetween adhocsh sessions the command history is lost. The readline module provides methods to handle command line history. Configure readline to store command history. For example, $XDG_DATA_HOME/adhocsh/<command>.history.

Support Directory Specific Command History

Provide an option to enable directory specific history. The history filename has to be adjusted to account for $PWD. Since some characters have to be encoded (e.g. /) a hash of the $PWD could be used. For example, the path /home/xxx/dev/adhocsh can be encoded with MD5 as git-15c459cee1c51105b2b787d98dd90626.history.

Add Exit Code Indicator to Prompt

Although completion leads the way to well-formed commands errors due to missing arguments and the like can still occur. Since error messages might be surrounded by other output an indicator concerning the exit status would be useful.

Colorize the prompt at least for $! > 0.

Handle Errors when Rendering a Specialized Prompt

There are some specialized prompts, e.g. for Git and Taskwarrior, which show useful information. Unfortunately, if an error occurs during rendering of such a prompt the shell will exit immediately. Provide a fallback prompt to avoid unintended exit.

Add Option for Shell Expansion

Aside from quotes, expansion of special characters like * or {} is sometimes useful, sometimes not. For example, using wildcards to specify a set of files to be committed in Git is pretty convenient. On the other hand, escaping all decorative characters is annoying when a phrase of an Taskwarrior item should be emphasized (e.g. *), quoted or bracketed (e.g. ()).

To activate shell expansion depending on the use case an option should be added.

Missing Closing Quotes Cause Fatal Error

Bug can be reproduced as follows:

$ ./adhocsh git
> commit -m "
[...]
Traceback (most recent call last):
  File "./adhocsh.py", line 240, in <module>
    print ("Error: " + e.message)
                       ^^^^^^^^^
AttributeError: 'ValueError' object has no attribute 'message'

Fix (Fallback) File Completion

There is an issue in the fallback file completion (used if no matches are generated by the primary Bash completion script) which omits the directory component of files in sub-directories. For example, the git> diff tests/exa<TAB> will result in git> diff example.py.

Migrate to Python 3

Python 2 has reached end of life on January 1st, 2020 [src]. Adhocsh needs to migrate to Python 3.

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.