Questions tagged [command-line]
Command-line interface or command-line interpreter, a means of interacting with a computer by means of textual commands and short scripts.
67
questions
-1
votes
1
answer
200
views
Why have a path argument when there is cwd
When writing a program that uses a working directory, e.g., PostgreSQL data directory or download target for wget, is there an advantage of having a CLI argument (or an environment variable) for such ...
4
votes
3
answers
601
views
Using Gregorian Year vs using Mean Tropical Year
I was working on a small CLI tool to convert between time units and seconds.
Someone filed an issue about how the code was treating a year as 365.25 days while the Gregorian year is supposed to be 365....
0
votes
2
answers
773
views
Is MVC a sensible design choice for a CLI application?
I am working on a CLI chess game that only involves 2 human players, I decided to make it follow the MVC architecture to ensure separation of concern and to make the possibility of a GUI/web ...
3
votes
1
answer
770
views
What are the best practices to design a "verbose" mode in command line scripts?
To improve my command lines scripts, I want to add some optional console output, mainly for logging purposes. In my PowerShell modules, I use Write-Verbose for this (but it should be clear this isn't ...
-1
votes
1
answer
850
views
Local Path on Linux [closed]
As we all know /usr/local/sbin, /usr/local/bin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games and /snap/bin are directories that Linux commands ( Except ones that built-in to shell and custom ...
2
votes
1
answer
476
views
Is there a standard technique to implement command line options within programme for CLI?
I am writing a command line tool in C++ that takes several arguments, some of them file names but also option parameters.
Is there a standard way to parse and implement these options? A simple way ...
-5
votes
2
answers
615
views
How to design a terminal?
Good day everyone.
I am planning to build a terminal, which will support common commands like ls, cd, cat, etc. But I am confused on how I should structure my codebase so that if in future, I decide ...
2
votes
2
answers
145
views
Processing user commands and parameters
I'm writing a GUI application which needs the facility for users to interact with the system and execute tasks via a sort of command line interface.
The user will type commands in a text box, with ...
1
vote
1
answer
108
views
Abstracting common functionality for REST and CLI
I have made an application that deals with collections of images. Currently it has a REST api to add/remove images, create/clear/delete collections and a worker that can automatically fetch images ...
0
votes
2
answers
531
views
How to handle command line parameters
I am writing a gui that is supposed to replace a fairly large shellscript in order to make the usage easier for not-so-technical people.
The script calls a certain program (saga_cmd) multiple times ...
1
vote
2
answers
110
views
CLI tool with overloadded structure
I have a python CLI tool that my department uses to process some excel file aided by a yaml. I tried to diagram a basic work flow here:
Step 1: User downloads a xlsx, puts it in a file, runs tool --...
4
votes
2
answers
166
views
Grouping non-boolean command-line options
This is just a quick question about standard CLI-parsing design.
Say we have:
foo -abc
for most CLI-parsers, a single - dash (as opposed to a double dash --) means you can group single letter ...
3
votes
5
answers
990
views
How to pass command line parameters to various parts of program
Consider a large program with many different parts that have a single command line interface, as is the case with most applications. How best do I handle passing various command line parameters, that ...
10
votes
6
answers
9k
views
Positional arguments vs options in a command-line interface
Consider the following command-line program manage-id. It does these things:
manage-id list (list all usernames and user-ids)
manage-id show <username> (shows ...
15
votes
3
answers
2k
views
What is the right way to manage developer scripts?
Developers create scripts to help in their work. For example, to run Maven with certain parameters, to kill unneeded background tasks that crop up in development, or to connect to a certain server. ...
0
votes
1
answer
85
views
Is there a normal way to program a CLI script that overrides default parameters in python
If I've got a script that uses a config file (or defaults to a generic config file) that calls another module which needs the config file passed to it as a parameter should I always
File 1 (the ...
-3
votes
1
answer
1k
views
What parser algorithm is best suited for command line parsing?
I want to write my own command line library from scratch. What algorithm should I use in order to parse gnu style args like in getopt for example ? I mean what's the best way other than tokenizing and ...
1
vote
1
answer
2k
views
Command Line Interface MVC Architecture
I just learned about the MVC architecture. I was going back and working on a command line file transfer application I wrote, and I was curious, to what degree should command line interfaces follow the ...
-4
votes
4
answers
1k
views
What are good ways to parse a large amount of input for a C++ application [closed]
For small command line applications I can get away with simple command line input.
./test input.png output.png
But for larger applications that requires a lot of input, simply using command
line ...
-2
votes
1
answer
413
views
What is the "Best Design" for implementing a Command Line which calls ReST API?
Basically I am calling a Server and expect a JSON response. The complication is when I need to pass the parameter which is in the form of JSON. The initial outcome of my thought process was to have a ...
6
votes
1
answer
604
views
Name of notation used when documenting command line parameters
Often, command line parameters are documented using a vaguely EBNF-ish notation such as the following:
The output of dir /? on Windows:
DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D]...
3
votes
3
answers
273
views
patterns for converting user command-line input into computer commands
The problem: 50 different commands which are typed into a command line for a program, lets say for telling a robot what to do. Some of the commands have user determined values such as travel north 5 (...
0
votes
1
answer
67
views
For interaction by other programs: command line, sockets, or something else?
I'm beginning an open-source project for logging work hours. The intention is to build something similar to Git, where instead of pushing code you're pushing information about work hours and progress.
...
1
vote
2
answers
374
views
Standard for implementing GUIs for command line utilities
I wrote a command-line utility and I want to develop a GUI for it. I saw that almost every tool on linux comes command-line, and it eventually has a GUI which interacts with the command line utility ...
-3
votes
1
answer
116
views
What does set.seed(any number) command means? [duplicate]
I am currently studying R. While studying that I came across a command set.seed(any number) . After googling also I didn't understood much except that it has something to do with Random number ...
3
votes
2
answers
172
views
Do there exist terms or classifications that describe the type of command line program you are writing?
Are there terms that are used to describe what kind of command line program you are programming based on how the program is designed to interact with the user?
For example, I can write a program that
...
1
vote
1
answer
589
views
Cross-platform unicode support for Python command line tool
I am working on a large command line tool, written for Python 2.6+ and supported for Windows, OS X and Linux. The target users are developers but it is also being auto-invoked by CI-systems etc. In ...
-5
votes
2
answers
464
views
How is "CURSES" a pun for "cursor optimization"? [closed]
I've begun implementing a support library for curses in Python.
Along the way, I became curious why the project was called "curses" to begin with. According to one NCURSES documentation, the name is ...
-1
votes
1
answer
263
views
Is it safe to execute the "regedit" command on Windows? [closed]
I'm writing a Java application, I need to create a URI Scheme.
I've seen a library creating a URI Scheme using the "regedit" command on Windows.
Is it safe to execute "regedit" for this task? Is ...
3
votes
2
answers
10k
views
Should the main method be separate in a separate class? [closed]
In Java main methods often do little more than parsing the command line arguments and initializing an object that then takes over, for example:
public class FooServer {
// ...
public static ...
4
votes
2
answers
146
views
Should program arguments have mixed interpretations?
I'm developing a command-line tool that has many user options. Some of the options are lists of values. I'd like the program to be able to parse these listed options directly from the command line, ...
0
votes
2
answers
397
views
Is renaming an 'alias' for moving?
Is it true to say (on Windows and Unix\Linux\OS X) that renaming a file or directory is just an alias for moving?
e.g.
Are there any side effects to either which are not present on the other?
Does '...
0
votes
1
answer
204
views
Unix way of filtering/mapping/mapcatting records via the pipeline?
At home I use Linux and have for more than a decade. At work we use Windows and so I find PowerShell more familiar. I am a Linux/Unix fanboy at heart, but I've had greater success grokking the ...
1
vote
1
answer
87
views
Why don't terminals support standard keyboard shortcuts? [closed]
On OS X you can use cmd+left/right to jump to the beginning/end of the line, or option+left/right to jump word by word. In just about every application.
But not in the Terminal. Nor iTerm. You have ...
5
votes
2
answers
2k
views
can a closed source commercial software make system(3) calls to GPL applications (not libraries)?
The closed source commercial software (CSCS), will just make system(3) calls to GPL applications.
The user machine will run CSCS and it will call these GPL applications, in realtime, in the very same ...
8
votes
4
answers
1k
views
Is it allowed to embed an LGPL command-line tool?
I want to sell a closed-application that depends upon a certain command line tool. Am I allowed to distribute my software including this command line tool?
For example, as a separate binary ...
-1
votes
1
answer
124
views
"Grep" that highlights instead of filter [closed]
I was wondering if there is a program in the common unix toolset such as grep that instead of filtering the lines that contain a string, simply outputs the same input but highlighting or coloring the ...
3
votes
2
answers
4k
views
OOP CLI menu structure organization?
This problem has kept me from pursuing a project I'm working on because it influences the entire structure of the application. This question has been briefly touched on here, but I feel that it wasn't ...
0
votes
3
answers
234
views
Usage of the argv[0]
Lately I've discovered that the latex and pdftex (with some other one) binaries in Ubuntu are the same:
lrwxrwxrwx 1 root root 6 лип 29 18:03 latex -> pdftex*
lrwxrwxrwx 1 root root ...
4
votes
2
answers
188
views
Factors for choosing between using a wrapper library or issuing command line process from my web application
I have a Java web application that makes use of certain libraries for example: Ghost Script for converting PDFs to TIFFs and Tesseract for OCR. There are java wrappers for both of these: Ghost4J and ...
1
vote
1
answer
822
views
Add arguments to mysql in Django's "dbshell"
I'd like to add a couple of command-line arguments to my Django's ./manage.py dbshell command, and I can't figure out how.
In specific I'd like to add -A to prevent MySQL from scanning every table ...
0
votes
1
answer
114
views
How did the "abnormal" options in shell commands appear?
These options which obscure me are like
ps aux, route -ee, gcc -fPIC xxx, find . -name xxx and so on.
The examples above aren't comprehensive.
I.e., I don't think that the argument handle ...
1
vote
1
answer
151
views
How do programs generally get information from the OS?
In many languages there are libraries, either built into the language itself or built separately outside of the language, which allow information to be taken from the operating system at some level. ...
-1
votes
2
answers
176
views
IS a command-line (Console) is important to learn for ASP.NET developer? [closed]
I saw many RoR developers use command line to interact with interfaces and to deploy their web applications. Is that necessary step to earn for asp.net developer?
2
votes
0
answers
117
views
Simple avenues for dynamically building Windows executables
I'm trying to build a Firefox add-on which lets you create executable files which can be associated with a default program or added to the "Open With" list and possess its own icon.
I was hoping to ...
1
vote
1
answer
386
views
Where does the tradition of shell prompts in code snippets come from?
Most code samples I see that demonstrate shell code preface each command with $. Having a prefix makes sense, but I'm confused as to why $ is used in particular. Some other symbol, like !, that can be ...
14
votes
3
answers
663
views
When is it appropriate to use colour in a command-line application?
Currently I have a command-line application in C called btcwatch. It has a -C option that it can receive as an argument that compares the current price of Bitcoin with a price that was stored ...
1
vote
2
answers
198
views
Need a simple compact program to execute few commands
(On Windows 7 64 bit)...
I am looking for a program, something similar to the default Windows Terminal, what I need it to do is:
Load text from a given URL, split the code in two variables and then ...
0
votes
1
answer
8k
views
Creating java package on ubuntu? [closed]
I am new to java. Here I am trying to create java package. And try to compile it from another directory . But there is an error like bash: /home/gaurav/Desktop/package2/B.java: Permission denied
Here ...
1
vote
4
answers
2k
views
Checking for minimum number of command-line arguments, but allowing help switch
I just ran into an odd scenario. I’m sure that I must have run into the same situation in the past and yet somehow not noticed it until now.
I am writing a program that requires at least two command-...