Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fsmi-klausurarchiv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fsarbeit.imt
fsmi-klausurarchiv
Commits
e23c3e80
There was an error fetching the commit references. Please try again later.
Commit
e23c3e80
authored
Aug 27, 2018
by
Dennis Baurichter
Browse files
Options
Downloads
Patches
Plain Diff
rename: Add valid fields to --help
parent
b48e222b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/rename
+6
-4
6 additions, 4 deletions
bin/rename
with
6 additions
and
4 deletions
bin/rename
+
6
−
4
View file @
e23c3e80
...
...
@@ -24,6 +24,7 @@ fInbox=False
files
=
[]
commitDir
=
None
setFields
=
dict
()
validFields
=
[
"
lecture
"
,
"
examiner
"
,
"
examType
"
]
for
cmd
in
pdfViewersAll
:
if
shutil
.
which
(
cmd
)
!=
None
:
...
...
@@ -98,14 +99,15 @@ def print_help(f):
"
-s|--set-field <field> <item>
\n
"
"
Provide a default for a specific field that is used in every
\n
"
"
renaming. If it is an exam type, it overrides anything that might
\n
"
"
already be there.
\n
"
"
already be there.
Valid fields are: {valFields}
\n
"
"
environment variables:
\n
"
"
KA_PDF_VIEWER
\n
"
"
executable name of the preferred pdf viewer. This serves as the
\n
"
"
default for --pdf-viewer.
\n
"
""
.
format
(
pdfViewer
=
pdfViewer
,
pdfViewers
=
"
|
"
.
join
(
sorted
(
pdfViewers
))
pdfViewers
=
"
|
"
.
join
(
sorted
(
pdfViewers
)),
valFields
=
"
,
"
.
join
(
validFields
)
)
)
...
...
@@ -137,7 +139,7 @@ try:
s
=
None
elif
s
==
"
--set-field
"
:
field_name
=
arg
if
not
arg
in
{
"
lecture
"
,
"
examiner
"
,
"
examType
"
}
:
if
not
arg
in
validFields
:
raise
CLEx
(
"
Invalid field name: %s
"
%
arg
)
s
=
"
--set-field:1
"
elif
s
==
"
--set-field:1
"
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment