joowani / dtags Goto Github PK
View Code? Open in Web Editor NEWCommand-line tool for tagging directories.
License: MIT License
Command-line tool for tagging directories.
License: MIT License
According to the README, the directory command (d
) can be used as a replacement for cd
.
I would like to try that, but I would like it to be a bit quieter similar to cd
. I don't want it to announce what directory I am going to. This is in line with the Unix philosophy of avoiding cluttering output with extraneous information.
I do see benefit in announcing what directory it will change to when an alias is given. This follows the principle of least astonishment, because it might even be ambiguous sometimes what my intentions are, if for instance there is a directory with the same name as my directory alias in the cwd.
So I would like it to not print the directory when using it like cd
in the normal way (not going to a tagged directory) and only print the directory name when going to a tag.
Otherwise, I would like a --quiet
flag that could disable the output entirely when changing directories.
Thanks.
It would be very convienient to have the option to chain commands with "&&", e.g. run tag -c "git fetch && git pull" or run tag -c 'git fetch && git pull'.
$ dtags edit
Traceback (most recent call last):
File "/usr/bin/dtags", line 9, in <module>
load_entry_point('dtags==2.0.0', 'console_scripts', 'dtags')()
File "/usr/lib/python3.5/site-packages/dtags/commands/manage.py", line 208, in main
_edit(tail)
File "/usr/lib/python3.5/site-packages/dtags/commands/manage.py", line 63, in _edit
tfile.write(EDIT_HELP_COMMENTS + mapping_file.read())
File "/usr/lib/python3.5/tempfile.py", line 483, in func_wrapper
return func(*args, **kwargs)
TypeError: a bytes-like object is required, not 'str'
It happens with Python 3.5, no problem with Python 2.7.
after fish shell upgrade to version 3.0 , dtags giving error like this.
math: Error: Missing operator
'1 > 1'
^
math: Error: Missing operator
'1 < 1'
^
math: Error: Missing operator
'2 == 0'
^
math: Error: Missing operator
'2 == 1'
^
IDK if it's just my current shell or whether the behaviour has changed, but previously just d
by itself would take me to the home directory, whereas now it complains that argument is required.
Certainly from my perspective it would be more intuitive to have d
mimic cd
, which would return to home.
http://i.imgur.com/MoZfuFf.png
See picture.
Is there a reason why other characters (e.g. I have some tags with numbers in them) are no longer supported? If not, could numbers be re-allowed?
MAC,after install ,finished configure bash_profile, all commads can be used normally,but when use 'd' with error.
Right now, the scripts are hard to read and modify because we don't get syntax highlighting or other editor features. Refactoring them into proper template files would be helpful for modifying the scripts.
Mustache templates would be a good choice. Another simple option would be to use %VARIABLE%
for variables and then do a simple search and replace.
Hi,
I tried dtags today and so far, it seems really nice :-)
But as I tried the "dtags edit" command I got following traceback:
$ dtags edit
Traceback (most recent call last):
File "/usr/bin/dtags", line 9, in
load_entry_point('dtags==2.0.0', 'console_scripts', 'dtags')()
File "/usr/lib/python3.5/site-packages/dtags/commands/manage.py", line 208, in main
_edit(tail)
File "/usr/lib/python3.5/site-packages/dtags/commands/manage.py", line 63, in _edit
tfile.write(EDIT_HELP_COMMENTS + mapping_file.read())
File "/usr/lib/python3.5/tempfile.py", line 483, in func_wrapper
return func(_args, *_kwargs)
TypeError: a bytes-like object is required, not 'str'
My $EDITOR ist set in the ~/.bashrc:
$ echo $EDITOR
/usr/bin/emacs -nw
(it also works, with every over programm, which calls the $EDITOR variable)
I'm using Arch Linux and have installed dtags through AUR.
It isn't a real problem for me (because I think, I can directly change the files in ~/.dtags), but I think, you are probably interested in this error.
If you need some other information, I'm happy to provide them.
Sincerely
that would be cool to have for automation's sake, from a sysadmin's PoV
CentOS 7
dtags 3.1.0
An error occurs as follows:
[root@node01 ~]# dtags
Traceback (most recent call last):
File "/usr/bin/dtags", line 7, in
from dtags.commands.manage import main
ImportError: No module named manage
[root@node01 ~]# t /usr/bin bin
-bash: t: command not found
How can I deal with this?thx..
I believe this project would be much more user friendly and easier to maintain if we could somehow get rid of the step that requires users to add command -v dtags > /dev/null 2>&1 && eval "
dtags shell zsh"
to their shell rc. The alternative would be to add an executable for d
into the PATH instead of relying upon an alias.
This seems to be a deliberate design decision on your part so I assume you did it for a reason. Could you please explain your thought process behind this decision?
If i went through the code more carefully and found a way to accomplish this without the eval step, would you consider a PR for this feature?
Now that I'm using dtags, I'm getting kind of spoiled by the convenience of my cd
command and I want the convenience for my other commands too for common shell operations.
For instance, if I want to copy a file from one of my tagged directories, I would like to do this
cp my-tagged-dir/some-file ./
To make this happen, I would like a command called expand
that can be used to accept a list of directories, and then print the list but with the tags expanded. Then I could do this:
dtags-cp() {
cp $(dtags expand $@)
}
If a tag is not found, simply leave it alone.
It would be nice if there was an automated way to do that with every command, but I can't think of how to do that since many commands can accept mixed input of commands and directories and it's hard to tell exactly which is which.
I would like to try out the stuff, but it simply does nothing on Windows 7, but drops the following message for example on dtags-t
:
Traceback (most recent call last):
File "C:\app\python3\Scripts\dtags-t-script.py", line 11, in <module>
load_entry_point('dtags==3.2.1', 'console_scripts', 'dtags-t')()
File "c:\app\python3\lib\site-packages\dtags\commands\t.py", line 30, in main
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
AttributeError: module 'signal' has no attribute 'SIGPIPE'
Googled for the answer and it seems that SIGPIPE
does not exist on Win.
As the README says:
p
is currently not fully supported on Windows
I assume that you can try out on Win, but if I'm right, it has to be running in Cygwin (Git-Bash doesn't work too).
Is it possible to run in native cmd.exe
? If not, then please write it to the documentation.
jonathan:~/ $ ls [15:19:29]
6.17.15 9.14 PM.pklg Downloads Public
Applications Library PycharmProjects
Applications (Parallels) Movies bin
Desktop Music phab
Documents Pictures
jonathan:~/ $ cd Documents [15:19:36]
jonathan:Documents/ $ cd .. [15:19:42]
jonathan:~/ $ d Documents [15:19:44]
Usage:
d [<dir>|<tag>]
d --help
d --version
Invalid argument: -10
suppose I have aliased g p
=> git pull
then
$ tag folder1 @tag1 folder2 folder3 @tag23; run @tag23 g p
folder2 (@tag23):
/bin/sh: g: command not found
folder3 (@tag23):
/bin/sh: g: command not found
can run
be made to execute in my ($whoami) context, i.e. $SHELL (zsh
) + my .rc (.zshrc
) file?
...instead of the error msg: t: directory path .../#.../... contains bad characters #
when t .../\#.../... tag1 is run
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.