Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sylvaine Ferrachat
make_script
Commits
a7af2127
Commit
a7af2127
authored
Mar 07, 2019
by
Sylvaine Ferrachat
Browse files
Improved helper message for --lang option
The list of available (aka 'supported') languages is now printed in the helper
parent
8b1b61de
Changes
1
Hide whitespace changes
Inline
Side-by-side
mk_script.py
View file @
a7af2127
...
...
@@ -36,6 +36,13 @@ tmpl_ext = '.tmpl'
config_header
=
'# Configure file for {}
\n
'
.
format
(
os
.
path
.
basename
(
sys
.
argv
[
0
]))
config_file
=
os
.
path
.
join
(
os
.
path
.
expanduser
(
'~'
),
'.mk_script.cfg'
)
# Supported languages helper
for
rootdir
,
dirs
,
files
in
os
.
walk
(
tmpl_dir
):
supported_lang
=
[
'.'
.
join
(
file
.
split
(
'.'
)[:
-
1
])
for
file
in
files
]
supp_lang_str
=
'(avail: '
supp_lang_str
+=
', '
.
join
(
supported_lang
)
supp_lang_str
+=
')'
#------------------------------------------
#-- Classes
class
Script
:
...
...
@@ -97,7 +104,7 @@ class Script:
def
run
(
filename
:
'file name of the script to create'
,
author
:
'author'
=
None
,
lang
:
'Script language to apply
'
=
DEFT_lang
,
lang
:
'Script language to apply
'
+
supp_lang_str
=
DEFT_lang
,
python_version
:
'Python version (will be discarded in no-python context)'
=
DEFT_python_version
,
with_begin
:
'include python "begins" lib (will be discarded in no-python context)'
=
DEFT_with_begin
,
with_license
:
'Include license identifyer'
=
DEFT_with_license
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment