forked from artisan-roaster-scope/artisan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand_utility.py
More file actions
59 lines (43 loc) · 1.54 KB
/
Copy pathcommand_utility.py
File metadata and controls
59 lines (43 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python3
# ABOUT
# Handeling of Commandline Utility Functions
# LICENSE
# This program or module is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 2 of the License, or
# version 3 of the License, or (at your option) any later versison. It is
# provided for educational purposes and is distributed in the hope that
# it will be useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
# the GNU General Public License for more details.
# AUTHOR
# FilePhil, 2020
from artisanlib import __version__
import sys
def handleCommands():
""" Handles incoming commands and decides on an action.
args -- given command line arguments
return -- if the action requires the application, return true
"""
for arg in sys.argv:
if arg in ('-v', '--Version'):
print ('Artisan Verison {}'.format(__version__))
return False
if arg in ('-h', '--Help'):
# To write a text that is not indented
# the text must be written like this
helpText ="""
Artisan Verison {}
Usage:
artsian
artsian [options] [path ...]
One path to a file may be specified. If there is an
existing Artisan window the path will be opened in the
viewer mode.
Options:
-h, --help Show help
-v, --Version Show version number
"""
print(helpText)
return False
return True