command-line-interface

How do Ruby and Python implement their interactive consoles?

只谈情不闲聊 提交于 2019-12-09 16:39:42
问题 When implementing the interpreter for my programming language I first thought of a simple console window which allows the user to enter some code which is then executed as a standalone program as a shell. But there are severe problems: If every line of code the user enters is handled as a standalone program, it has to go through the tokenizer and parser and is then just executed by the interpreter - what about functions then? How can the Python/Ruby interactive consoles (IDLE, irb) "share"

Python Curses without clearing screen

∥☆過路亽.° 提交于 2019-12-09 16:02:18
问题 This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 5 years ago . I would like to use Curses under Python without clearing the screen. The reason is that I would like my app to pop up a simple small menu over the existing screen and soon exit. It is acceptable, though not preferred, to leave the ugly pieces of the pop up menu on the screen upon exit. The idea is to use it for quick practical sysadmin apps and scripts where

How can I add Jenkins slave nodes via the CLI?

[亡魂溺海] 提交于 2019-12-09 15:46:52
问题 As per the title, in Jenkins how can I add new slave nodes to my build cluster using the CLI, or if there is not a CLI option, is there another scriptable approche that can be used? 回答1: Many people use the Swarm Plugin to eliminate the need to actually add slaves manually. You would need to script the install of the swarm agent of course, but that should be pretty straight forward. 回答2: Basic CLI instruction can be found here. The following CLI command should get the new node configuration

How to get linux console $COLUMNS and $ROWS from PHP cli?

若如初见. 提交于 2019-12-09 14:09:18
问题 I'm currently creating a new neat CLI library for PHP, and i'd like to figure out the width/height of the console it's running in. I've tried many things like digging through $_ENV, exec("echo $COLUMNS"), etc, but no result, while if i type echo $COLUMNS or $ROWS in bash commandline, it neatly displays the value. What do i need to do to access this value from PHP? I'm using .sh scripts like this: #!/usr/bin/php -q <?php require_once('lib.commandline.php'); class HelloWorld extends

How do I integrate the PhoneGap debug console with CLI?

僤鯓⒐⒋嵵緔 提交于 2019-12-09 11:10:23
问题 This page on the PhoneGap site http://docs.phonegap.com/en/3.3.0/guide_cli_index.md.html#The%20Command-Line%20Interface tells us how to use CLI to download the debug console ($ cordova plugin add org.apache.cordova.console). However, I see no further steps on how to integrate it into an Cordova iOS app on an HTML page. Where is the console information supposed to appear, in the Terminal window during a cordova emulate? In the Xcode console? Do I need to add anything to config.xml? 回答1: For

include file in project from command line

♀尐吖头ヾ 提交于 2019-12-09 10:27:10
问题 Is there a way to include a file in project from command line in vs2012 ? The reason why I'm asking is because is very frustrating to include any new file I add to the project folder whenever I use some other IDE ( like ST3 ) or when I save a file from Photoshop, etc. I'm using Grunt for doing a lot of minifying, concatenation, running ngmin on my angular scripts, etc. There's a grunt-shell plugin that allows grunt tasks to run shell commands ( I'm already using it for unlocking locked files

Interact with a locally long-running Common Lisp image, possibly daemonized, from the command line

☆樱花仙子☆ 提交于 2019-12-09 10:13:51
问题 How could one interact with a locally long-running Common Lisp image, possibly daemonized, from the command line? I know it is possible to run a Common Lisp function from a Terminal command prompt, I am also aware of this. I would need to do a similar thing, but with a local, already long-running Common Lisp image, being able to poll available functions from the CLI or shell scripts. Is there a way to do that from a CLI, for example calling a function from a bash script, and receiving back

Flush disk write cache from Windows CLI

杀马特。学长 韩版系。学妹 提交于 2019-12-09 08:54:05
问题 Does anyone know how to flush the disk write cache data from the cache manager for the current directory (or any given file or directory, for that matter), from a Windows command line? 回答1: I found the SysInternals Sync worked well for me - although it flushes ALL cache, not just for the specific folder. Example of usage: IF EXIST Output RD /S /Q Output && Sync && MD Output By default it flushes all cached data for all drives - you can specify command-line options to restrict which drives but

Changing Angular 5 publish url at runtime

痴心易碎 提交于 2019-12-09 07:03:13
问题 I want to build an Angular 5 app once, and then publish it to different addresses, for example to: https://sub1.example.com/myapp1 https://sub2.example.com/myapp2 https://sub3.example.com/myapp3 By default, Angular will assume that all files are hosted in / so when i access index.html, it will load scripts such as https://sub1.example.com/vendor.bundle.js which will 404 because it's deploy to /myapp1/vendor.bundle.js (to make it slightly more complex, I'm actually loading the files from a CDN

Whitespace in bash path with java

时间秒杀一切 提交于 2019-12-09 02:57:27
So, I try to export file variable: String somePath = "/Users/me/File with whitespaces.json"; Runtime runtime = Runtime.getRuntime(); runtime.exec(String.format("$MY_FILEPATH=\"%s\"", somePath)); And I get some exception on this line: java.io.IOException: Cannot run program "$MY_FILEPATH=/Users/me/File": error=2, No such file or directory P.S. If I try "prepend space in file name with \", I get: String somePath = "/Users/me/File\ with\ whitespaces.json"; Runtime runtime = Runtime.getRuntime(); runtime.exec(String.format("open %s", somePath)); And I also get some exception on this line: The