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

ttree asks to create config file even when "--file=FILE" command line option is specified #282

Open
KenNeighbors opened this issue Sep 16, 2020 · 0 comments

Comments

@KenNeighbors
Copy link

Reproduce bug:

mkdir /tmp/src /tmp/dest
touch /tmp/cfg
ttree --file=/tmp/cfg --src=/tmp/src --dest=/tmp/dest
Do you want me to create a sample '.ttreerc' file for you?
(file: /home/ken/.ttreerc)   [y/n]: n

Expected behavior:

ttree -f /tmp/cfg -s /tmp/src -d /tmp/dst

(no question asked about creating config file)

Fix bug by adding "--file=.*" to regex on line 47 in ttree:

--- ttree.orig	2020-09-16 09:52:47.256298488 -0700
+++ ttree	2020-09-16 10:14:47.011793186 -0700
@@ -44,7 +44,7 @@
 
 # offer create a sample config file if it doesn't exist, unless a '-f'
 # has been specified on the command line
-unless (-f $RCFILE or grep(/^(-f|-h|--help)$/, @ARGV) ) {
+unless (-f $RCFILE or grep(/^(-f|--file=.*|-h|--help)$/, @ARGV) ) {
     print("Do you want me to create a sample '.ttreerc' file for you?\n",
       "(file: $RCFILE)   [y/n]: ");
     my $y = <STDIN>;
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

No branches or pull requests

1 participant