FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SabreTools.Serialization/ExtractionTool/Program.cs at 2.2.0 · SabreTools/SabreTools.Serialization · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
SabreTools
/
SabreTools.Serialization
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
6
Code
Issues
3
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
SabreTools.Serialization
/
ExtractionTool
/
Program.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
79 lines (68 loc) · 2.41 KB
Breadcrumbs
SabreTools.Serialization
/
ExtractionTool
/
Program.cs
Copy path
File metadata and controls
79 lines (68 loc) · 2.41 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
69
70
71
72
73
74
75
76
77
78
79
using
System
;
using
System
.
Collections
.
Generic
;
using
ExtractionTool
.
Features
;
using
SabreTools
.
CommandLine
;
using
SabreTools
.
CommandLine
.
Features
;
namespace
ExtractionTool
{
public
static
class
Program
{
public
static
void
Main
(
string
[
]
args
)
{
#if
NET462_OR_GREATER
||
NETCOREAPP
// Register the codepages
System
.
Text
.
Encoding
.
RegisterProvider
(
System
.
Text
.
CodePagesEncodingProvider
.
Instance
)
;
#endif
// Create the command set
var
mainFeature
=
new
MainFeature
(
)
;
var
commandSet
=
CreateCommands
(
mainFeature
)
;
// If we have no args, show the help and quit
if
(
args
==
null
||
args
.
Length
==
0
)
{
commandSet
.
OutputAllHelp
(
)
;
return
;
}
// Cache the first argument and starting index
string
featureName
=
args
[
0
]
;
// Try processing the standalone arguments
var
topLevel
=
commandSet
.
GetTopLevel
(
featureName
)
;
switch
(
topLevel
)
{
// Standalone Options
case
Help
help
:
help
.
ProcessArgs
(
args
,
0
,
commandSet
)
;
return
;
// Default Behavior
default
:
if
(
!
mainFeature
.
ProcessArgs
(
args
,
0
)
)
{
commandSet
.
OutputAllHelp
(
)
;
return
;
}
else
if
(
!
mainFeature
.
VerifyInputs
(
)
)
{
Console
.
Error
.
WriteLine
(
"At least one input is required"
)
;
commandSet
.
OutputAllHelp
(
)
;
return
;
}
mainFeature
.
Execute
(
)
;
break
;
}
}
/// <summary>
/// Create the command set for the program
/// </summary>
private
static
CommandSet
CreateCommands
(
MainFeature
mainFeature
)
{
List
<
string
>
header
=
[
"Extraction Tool"
,
string
.
Empty
,
"ExtractionTool <options> file|directory ..."
,
string
.
Empty
,
]
;
var
commandSet
=
new
CommandSet
(
header
)
;
commandSet
.
Add
(
new
Help
(
[
"-?"
,
"-h"
,
"--help"
]
)
)
;
commandSet
.
Add
(
mainFeature
.
DebugInput
)
;
commandSet
.
Add
(
mainFeature
.
OutputPathInput
)
;
return
commandSet
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL