Thread Probleme mit GetOpt::Long (19 answers)
Opened by YAPD at 2019-06-23 15:58

rosti
 2019-06-28 07:58
#190156 #190156
User since
2011-03-19
3194 Artikel
BenutzerIn
[Homepage]
user image
Wie gesagt, mit

Code (perl): (dl )
1
2
# Der Name der Subklasse als erstes Argument
my $class = shift;


Wird der Name der zu ladenden Klasse aus @ARGV extrahiert. Und erst danach werden mit Getopt::Long::GetOptions(%opts); diese eingelesen. MFG

PS: Beispiel einer Anwendung diese Command Line Interface:



Code: (dl )
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
D:\>c.pl RPC
Remote CMD auf dem Host
--attribute, -a: Zeigt Attribut+Value einer Entity in Konfiguration
--base, -ba: Name der Datenbank für Option --sql
--binary, -bi: Erzeuge die Konfiguration als Binary
--cmd, -c: Freies Kommando im aktuellen Verzeichnis
--dump, -d: Dump Response Object
--entity, -e: Zeigt Attribute einer Entity in Konfiguration
--files, -f: Lokale Dateien für Upload
--head, -he: HEAD Request auf URL
--host, -ho: rolfrost.de oder rolfrost
--irc, -i: Chatserver starten
--request, -r: HTTP Request auf den angegebenen URL oder auf alle URLs
--sql, -s: SQL Anweisung, erfordert --base
--urls, -u: Listet URLs in Konfiguration

D:\>c.pl RPC -host rolfrost.de -ent /
class
descr
file
interface
short
title

D:\>c.pl RPC -host rolfrost.de -ent / -att class
HTMLfile
D:\>

D:\>c.pl RPC -host rolfrost.de -ent / -att title
FWNG, modern MVC Web Application Framework in Perl und in C



Die Idee die dahintersteckt: Ich muss mir nicht 'zig Scriptnamen merken sondern nur noch einen einzigen Scriptnamen: c.pl

Und genauso wie auf einem CISCO IOS werde ich da durch die Options geführt. Siehe oben: Durchs Menu hangeln.



.
Last edited: 2019-06-28 09:28:15 +0200 (CEST)

View full thread Probleme mit GetOpt::Long