Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commands with parameters #24

Merged
merged 2 commits into from
Apr 12, 2017
Merged

Conversation

yegarti
Copy link
Collaborator

@yegarti yegarti commented Mar 25, 2017

  • Added placeholders in commands using python3 string.Template. New features and improvements #11

  • Added '--safe' option to 'keep run' that will ignore missing arguments.

  • Added options to send the arguments to 'keep run' , this way you can use the shell completion.

Examples:

$ keep run "tar"

 1	$ tar zxvf $tarfile -C $dest :: Extract tar content to destination

Enter value for 'tarfile': /path/to/tar
Enter value for 'dest': /my/folder/

Execute
	$ tar zxvf /path/to/tar -C /my/folder/ :: Extract tar content to destination
? [Y/n]: 
$ keep run "test"

 1	$ replace $this and /path/to/${this}/file but not $$this :: test

Enter value for 'this': TEST

Execute
	$ replace TEST and /path/to/TEST/file but not $this :: test
? [Y/n]: 

Sending arguments from command line:

$ keep run "grep" /path/to/dir "data[0-9]+" "> file" 

 1	$ grep -irnw $dir -e $pattern $out :: Look for a regex pattern inside files

dir: /path/to/dir
pattern: data[0-9]+
out: > file

Execute
	$ grep -irnw /path/to/dir -e file_[0-9]+ > file :: Look for a regex pattern inside files
? [Y/n]:

Missing arguments:

$ keep run "grep" /path/to/dir "data[0-9]+"

 1	$ grep -irnw $dir -e $pattern $out :: Look for a regex pattern inside files

dir: /path/to/dir
pattern: data[0-9]+
Enter value for 'out':  

Execute
	$ grep -irnw /path/to/dir -e data[0-9]+   :: Look for a regex pattern inside files
? [Y/n]:

@OrkoHunter
Copy link
Owner

This is perfect! I had to use this while using youtube-dl multiple times today.

Thanks @paci4416 from the bottom of my heart.

@OrkoHunter OrkoHunter merged commit 0cb8199 into OrkoHunter:master Apr 12, 2017
This was referenced Apr 23, 2017
athityakumar pushed a commit to athityakumar/keep that referenced this pull request Feb 3, 2018
This merges in the new Git code, which now uses a global cache rather than being per-repository. This lets exa keep the Git column when listing files outside of a directory and when in recursive or tree views.

Fixes OrkoHunter#24 and #183.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants