command-line-interface

Passing a variable to PhantomJS via exec

时光怂恿深爱的人放手 提交于 2019-11-29 06:47:08
I'm getting started with Grunt and wanting to pass a variable to a PhantomJS script I'm running via exec. What I want to be able to do is pass a url in for the script to take the screen capture from. Any help would be greatly appreciated, thanks! Darren Grunt script exec('phantomjs screenshot.js', function (error, stdout, stderr) { // Handle output } ); screenshot.js var page = require('webpage').create(); page.open('http://google.com', function () { page.render('google.png'); phantom.exit(); }); Cybermaxs Command-line arguments are accessible via module require('system').args (Module System )

Java CLI UI-design: frameworks or libraries? [closed]

被刻印的时光 ゝ 提交于 2019-11-29 06:42:29
问题 I'm currently working on a small utility program that only requires a command line interface, and I started wondering if Java provided any standard way of creating the CLI, in a similar way that Swing and the likes exist for GUIs. I'm not really interested in command line parameters and parsing of them, but rather the command based interaction the user has with the program to use it. This is for the situations where GUI simply is unnecessary or not an option for using the program. Googling

Meteor Settings in a Deployed App

前提是你 提交于 2019-11-29 06:21:30
This is probably a very basic question, but this is my first time using Meteor + Heroku and I can't seem to figure out how to use the settings.json file after deploying a Meteor app (currently using heroku). From my hours of research on web, it seems that in order to use the settings in a deployed app, I have to do... export METEOR_SETTINGS="$(cat settings.json)" At first I thought that this is meant to go to a boostrap file... Then I realized I was wrong when I started get reserved word errors (because of "export") So... Where and how do I use this line? Am I suppose to use terminal to type

Python CLI program unit testing

末鹿安然 提交于 2019-11-29 06:06:14
问题 I am working on a python Command-Line-Interface program, and I find it boring when doing testings, for example, here is the help information of the program: usage: pyconv [-h] [-f ENCODING] [-t ENCODING] [-o file_path] file_path Convert text file from one encoding to another. positional arguments: file_path optional arguments: -h, --help show this help message and exit -f ENCODING, --from ENCODING Encoding of source file -t ENCODING, --to ENCODING Encoding you want -o file_path, --output file

SQLite Data Change Notification Callbacks in Python or Bash or CLI

∥☆過路亽.° 提交于 2019-11-29 04:16:57
SQLite has Data Change Notification Callbacks available in the C API. Can these callbacks be used from the SQLite CLI, or from Bash or from Python? If so, how? Can these callbacks be used from the SQLite CLI... Reading through the SQLite source code, it doesn't look like that function is used anywhere in the CLI source code, so I doubt you can do it via the CLI. ...or from Bash... Not sure what you mean by that. ...or from Python? It's not exposed via the standard sqlite3 module, but you can use it with the ctypes module. If so, how? Here's a quick n' dirty example of using it via ctypes ...

How can I edit PYTHONPATH on a Mac?

≡放荡痞女 提交于 2019-11-29 04:06:24
How can I permanently change the PYTHONPATH on a mac? I've tried editing .bash_profile, but when I use print sys.path in a file it gives a huge list of different URLs than the .bash_profile. In Terminal when I type echo $PYTHONPATH it shows a blank line. I don't want to use sys.path.append('...') because then I have to put that in every file. 0x90 You can append the path to $PATH and not to $PYTHONPATH . if you insist to change the PYTHONPATH , in some context that is prefferable: do this : export PYTHONPATH=$PYTHONPATH:/Users/username/pymodules To make sure you are following the convention of

Fatal error: Maximum execution time of 0 seconds exceeded

醉酒当歌 提交于 2019-11-29 03:13:30
My script compares 2 source trees, creates a map of possible changed files, compares MD5 hashes and creates a diff-package. After 28000-29000 files, PHP terminates the script with error: Fatal error: Maximum execution time of 0 seconds exceeded in /root/_PACKER-TESTER/core/diff.class.php on line 67 (standard in_array() call) I already tried to set max_input_time to high value (or zero) - nothing. Setting max_execution_time to 99999999999999 do nothing .... the same error. theamoeba Try setting max_input_time = -1 in php.ini , or using set_time_limit(-1) . That worked for me without rebuilding

How to upload file from command line as file parameter in jenkins

前提是你 提交于 2019-11-29 01:46:23
I am triggering builds with string parameters from the command line in Jenkins with: curl http://jenkins:8080/job/Build/buildWithParameters?PARAM=value&token=token I now want to trigger a build with a file as a file parameter from the command line. For example if my project builds main.c then I would like to be able to trigger a build and upload my main.c from the command line. Is this possible? This is described in the Jenkins Remote access API page: curl http://jenkins/job/$JOB_NAME/build -F file0=@PATH_TO_FILE -F json='{"parameter": [{"name":"FILE_LOCATION_AS_SET_IN_JENKINS", "file":"file0"

Click Command Line Interfaces: Make options required if other optional option is unset

时光总嘲笑我的痴心妄想 提交于 2019-11-28 23:46:11
When writing a command-line interface (CLI) with the Python click library , is it possible to define e.g. three options where the second and third one are only required if the first (optional) one was left unset? My use case is a log-in system which allows me to authenticate either via an authentication token (option 1), or, alternatively, via username (option 2) and password (option 3). If the token was given, there is no need to check for username and password being defined or prompting them. Otherwise, if the token was omitted then username and password become required and must be given.

Mac Terminal - How to start Android Virtual Device Manager on CLI?

独自空忆成欢 提交于 2019-11-28 23:18:01
I am currently developing a mobile web application and I don't have a test device yet so I'm using the android-emulator to check the site. On my mac, I have installed the stand-alone Android SDK. Every time I want to use the AVD Manager, I have to execute the following on my terminal: monitor This command (being executed on the installed android sdk path) will open the Android Device Monitor and from here, I go to its menu bar and select Window Virtual Device Manager just to open the AVD Manager. So, is there a shortcut for that? I mean, i want to directly open the AVD manager via cli . In