MCPcopy Index your code
hub / github.com/benfry/processing4 / Commander

Method Commander

java/src/processing/mode/java/Commander.java:76–276  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

74
75
76 public Commander(String[] args) {
77 String sketchPath = null;
78 File sketchFolder = null;
79 String pdePath = null; // path to the .pde file
80 String outputPath = null;
81 File outputFolder = null;
82 boolean outputSet = false; // set an output folder
83 boolean force = false; // replace that no good output folder
84// String preferencesPath = null;
85// int platform = PApplet.platform; // default to this platform
86// int platformBits = Base.getNativeBits();
87 String variant = Platform.getVariant();
88 int task = HELP;
89 boolean embedJava = true;
90
91 if (Platform.isWindows()) {
92 // On Windows, it needs to use the default system encoding.
93 // https://github.com/processing/processing/issues/1633
94 systemOut = new PrintStream(System.out, true);
95 systemErr = new PrintStream(System.err, true);
96 } else {
97 // OS X formerly used MacRoman or something else useless.
98 // (Not sure about Linux, but this has worked since 2.0)
99 // https://github.com/processing/processing/issues/1456
100 systemOut = new PrintStream(System.out, true, StandardCharsets.UTF_8);
101 systemErr = new PrintStream(System.err, true, StandardCharsets.UTF_8);
102 }
103
104 int argOffset = 0;
105 for (String arg : args) {
106 argOffset++;
107
108 if (arg.length() == 0) {
109 // ignore it, just the crappy shell script
110
111 } else if (arg.equals(helpArg)) {
112 // mode already set to HELP
113
114// } else if (arg.equals(preprocArg)) {
115// task = PREPROCESS;
116
117 } else if (arg.equals(buildArg)) {
118 task = BUILD;
119 break;
120
121 } else if (arg.equals(runArg)) {
122 task = RUN;
123 break;
124
125 } else if (arg.equals(presentArg)) {
126 task = PRESENT;
127 break;
128
129 } else if (arg.equals(exportApplicationArg)) {
130 task = EXPORT;
131 break;
132
133 } else if (arg.equals(noJavaArg)) {

Callers

nothing calls this directly

Calls 15

getVariantMethod · 0.95
isWindowsMethod · 0.95
complainAndQuitMethod · 0.95
subsetMethod · 0.95
printCommandLineMethod · 0.95
removeDirMethod · 0.95
initMethod · 0.95
loadMethod · 0.95
getContentFileMethod · 0.95
buildMethod · 0.95
presentMethod · 0.95

Tested by

no test coverage detected