diff options
author | hut <hut@lavabit.com> | 2011-10-21 11:28:42 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2011-10-21 11:28:42 +0200 |
commit | 19bf3029b53b7d879f7d93d929b1e82449743ffe (patch) | |
tree | 49b44d0d969f2086b7f359e4381f2158f9644fbe /ranger | |
parent | 5f67653b6ae232f7475049136421df0d016d283c (diff) | |
download | ranger-19bf3029b53b7d879f7d93d929b1e82449743ffe.tar.gz |
core.actions: added --choosefiles option + doc
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/core/actions.py | 6 | ||||
-rw-r--r-- | ranger/core/helper.py | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 20b910da..0fd60b9a 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -249,6 +249,12 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): # ranger can act as a file chooser when running with --choosefile=... if ranger.arg.choosefile: open(ranger.arg.choosefile, 'w').write(self.fm.env.cf.path) + + if ranger.arg.choosefiles: + open(ranger.arg.choosefiles, 'w').write("".join( + f.path + "\n" for f in self.fm.env.get_selection())) + + if ranger.arg.choosefile or ranger.arg.choosefiles: raise SystemExit() if isinstance(files, set): diff --git a/ranger/core/helper.py b/ranger/core/helper.py index 995be7c5..46d35f7a 100644 --- a/ranger/core/helper.py +++ b/ranger/core/helper.py @@ -56,6 +56,10 @@ def parse_arguments(): help="Makes ranger act like a file chooser. When opening " "a file, it will quit and write the name of the selected " "file to TARGET.") + parser.add_option('--choosefiles', type='string', metavar='TARGET', + help="Makes ranger act like a file chooser for multiple files " + "at once. When opening a file, it will quit and write the name " + "of all selected files to TARGET.") parser.add_option('--choosedir', type='string', metavar='TARGET', help="Makes ranger act like a directory chooser. When ranger quits" ", it will write the name of the last visited directory to TARGET") |