Apache Commons
commons.apache.org › proper › commons-cli › apidocs › org › apache › commons › cli › CommandLine.html
CommandLine (Apache Commons CLI 1.11.0 API)
org.apache.commons.cli.CommandLine · All Implemented Interfaces: Serializable · public class CommandLine extends Object implements Serializable · Represents list of arguments parsed against a Options descriptor. It allows querying of a boolean hasOption(String optionName), in addition to ...
Apache Commons
commons.apache.org › proper › commons-exec › apidocs › org › apache › commons › exec › CommandLine.html
CommandLine (Apache Commons Exec 1.6.0 API)
org.apache.commons.exec.CommandLine · public class CommandLine extends Object · CommandLine objects help handling command lines specifying processes to execute. The class can be used to a command line by an application. Constructors · Constructor · Description ·
Videos
19:37
Looking into Apache Common CLI - YouTube
05:12
Apache Commands You Should Know - YouTube
Practical Apache Admin Part 2 | Apache Basics | Fundamental ...
06:41
Using a Command Line Web Server - YouTube
- YouTube
36:48
Demonstration of Apache Commons CLI API - YouTube
Apache Commons
commons.apache.org › cli
Apache Commons CLI – Apache Commons CLI
November 8, 2025 - The Apache Commons CLI library provides an API for parsing command-line options passed to an application. It can also print help detailing the options available for that application · Commons CLI supports different types of options:
Apache Commons
commons.apache.org › exec › commandline.html
Apache Commons Exec - Building the command line – Apache Commons Exec
No matter which approach you are using commons-exec does change your command line arguments in the following two cases · The following executable arguments
Apache Commons
commons.apache.org › cli › apidocs › org › apache › commons › cli › CommandLine.html
CommandLine (Apache Commons CLI 1.8.1-SNAPSHOT API)
October 23, 2021 - org.apache.commons.cli.CommandLine · All Implemented Interfaces: Serializable · public class CommandLine extends Object implements Serializable · Represents list of arguments parsed against a Options descriptor. It allows querying of a boolean hasOption(String optionName), in addition to ...
DZone
dzone.com › coding › java › java command-line interfaces (part 1): apache commons cli
Java Command-Line Interfaces (Part 1): Apache Commons CLI
June 22, 2017 - The Apache Commons CLI documentation's "Introduction" explains how Commons CLI accomplishes the "three stages [of] command line processing" ("definition", "parsing", and "interrogation"). These three stages map in Commons CLI to classes Option and Options ("definition"), to interface CommandLineParser ("parsing"), and to class CommandLine ("interrogation").
TutorialsPoint
tutorialspoint.com › commons_cli › commons_cli_quick_guide.htm
Apache Commons CLI - Quick Guide
The Apache Commons CLI are the components of the Apache Commons which are derived from Java API and provides an API to parse command line arguments/options which are passed to the programs.
Tabnine
tabnine.com › home › code library
Code Library - Tabnine
July 25, 2024 - Get the answers and suggestions you need from our AI code assistant. Get started in minutes with a free 90 day trial of Tabnine Pro.
TutorialsPoint
tutorialspoint.com › commons_cli › index.htm
Apache Commons CLI Tutorial
The Apache Commons CLI are the components of the Apache Commons which are derived from Java API and provides an API to parse command line arguments/options which are passed to the programs.
GitHub
github.com › apache › commons-cli › blob › master › src › main › java › org › apache › commons › cli › CommandLine.java
commons-cli/src/main/java/org/apache/commons/cli/CommandLine.java at master · apache/commons-cli
private CommandLine(final List<String> args, final List<Option> options, final Consumer<Option> deprecatedHandler) {
Author apache
GitHub
github.com › apache › commons-exec › blob › master › src › main › java › org › apache › commons › exec › CommandLine.java
commons-exec/src/main/java/org/apache/commons/exec/CommandLine.java at master · apache/commons-exec
import org.apache.commons.exec.util.StringUtils; · /** * CommandLine objects help handling command lines specifying processes to execute. The class can be used to a command line by an application. */ public class CommandLine { · /** * Encapsulates a command line argument.
Author apache
Lyris
lunar.lyris.com › help › lm_help › 4.0 › ApacheCommandLine.html
Apache Command Line
Lyris User's Guide [previous] [next] [contents] Apache Command Line Table of Contents Introduction Email Commands Web Interface for Users Server Administrator Site Administrator List Administrator Other Topics Add-On Packages NT Authentication Option Lyris List Manager ODBC Driver Random Document ...
Maven Repository
mvnrepository.com › artifact › commons-cli › commons-cli
Maven Repository: commons-cli » commons-cli
November 13, 2025 - Apache Commons CLI provides a simple API for presenting, processing, and validating a Command Line Interface.
Top answer 1 of 2
3
I think you're looking for the getArgList or the getArgs method. From the documentation:
Retrieve any left-over non-recognized options and arguments
So instead of this:
if (args.length <= 0 || cmd.hasOption("help"))
Use like this:
if (cmd.getArgs().length == 0 || cmd.hasOption("help"))
2 of 2
2
Note that cmd.getArgs().length do not count switches (-xxxx) on the command line - only args not starting with dash
Top answer 1 of 7
19
What about apache debug mode (-X) ?
apache2 -X -d. -f.htaccess -C"PidFile `mktemp`" -C"Listen 1025"
-C"ErrorLog /dev/stdout" -C"DocumentRoot `pwd`"
to put it in the background once started you may use Ctrl^Z then type "bg"
Using the the FOREGROUND flag, wrapping it up in a shell script:
#!/bin/sh
if [ $# -ne 2 ]; then
echo "$0 <port> <dir>"
exit 10
fi
/usr/sbin/apache2 -DFOREGROUND -d. -f.htaccess -C"PidFile `mktemp`" \
-C"Listen $1" -C"ErrorLog /dev/stdout" -C"DocumentRoot $2" -e debug
call it "pache", chmod +x, then you can run
./pache 1026 /tmp/webroot
2 of 7
7
http-server is a much better simple http server than pache, it's what I use currently! :)
Use [pache][1]
Install with npm - which comes with node here: http://nodejs.org/
sudo npm install pache -gRun on current dir, port 3000:
pacheOr specify directory and port:
pache site-directory 2000[1]: https://github.com/devinrhode2/pache
Apache Commons
commons.apache.org › proper › commons-cli › apidocs › index.html
Overview (Apache Commons CLI 1.11.0 API)
The parse methods of CommandLineParser are used to parse the command line arguments. There may be several implementations of the CommandLineParser interface, the recommended one is the DefaultParser.
Ex Libris
knowledge.exlibrisgroup.com › cross-product › knowledge articles
Stopping, starting, and restarting apache from the command line - Ex Libris Knowledge Center
December 6, 2021 - A guide for starting and stopping apache from the command line.