-
Notifications
You must be signed in to change notification settings - Fork 0
/
dpropts.nim
68 lines (51 loc) · 1.35 KB
/
dpropts.nim
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
60
61
62
63
64
65
66
67
68
const VERSION* {.strdefine.} : string = "<undefined>"
const MAXOPTS* = 1000000
proc hasArg*(args:var seq[string], a:string, position:int = -1) : bool =
for i in 0..<args.len:
if args[i]==a:
args.delete(i)
return true
false
const dprCmd = """ info
install
list
orphan
remove|uninstall
search
where|file|files
update
upgrade"""
const facesList* = """ --apt-face
--brew-face
--choco-face
--dnf-face
--dpr-face
--emerge-face
--pacman-face
--zypper-face"""
const targetsList* = """ --apk
--apt
--brew
--choco
--dnf
--opkg
--paru
--pikaur
--pacman
--yaourt
--yay"""
const targetArgHelp* = """Please select one of the desired targets:
""" & targetsList
const fullHelp* = """
dpr: A meta-package interface to most common packaging systems.
Instead of learning the syntax of a package manager, let dpr do the translation for you.
Version """ & VERSION & """
Usage: dpr [--FACE] [--TARGET] OTHER_OPTIONS...
The --FACE option defines the actual command line interface to use. On consecutive runs, the application remembers the last face used.
The --TARGET option could be guessed based on the current system. This property is not saved.
List of valid --FACE options:
""" & facesList & """
List of valid --TARGET options:
""" & targetsList & """
List of possible commands, with dpr as target:
""" & dprCmd