cli

How to wrap a CLI program in Python (keeping the interactivity)?

Hello everybody, I'd like to write a wrapper for an interactive CLI Program (the Asterisk CLI). Basically, I need to keep the interaction with the CLI (including tab-completion) but I want to filter the output of Asterisk, in order to show only lines matching a given pattern. I tried a select() based approach, using popen.popen4 and pu...

How to work with multiple word resources in Zend_Tool

So I've got a controller that I want to be camel cased: MisterFoobarController So I created it like this: zf create controller mister-foobar which created something like Mister-foobarController.php but inside of it created it correctly as MisterFoobarController. How do I create camel cased multiple word resources with the Zend_To...

MySQL 5.1 command line problem: delete last char doesn't work

I can't delete the last character in a given line in the MySQL CLI, if I press "END", it will jump on the character and if I press "DEL", it will delete the char before that (like backspace). Does anybody know a fix for that issue? I use MySQL 5.1.31-1ubuntu2-log with normal shell access. Thank you for assistance! ...

Why does not C# support operator overloading with pass by reference?

Is this a CLR restriction or a language design decision? I tried to do it in C++/CLI, of course where it works because the need to support native c++: public ref class Test { public: static Test^ operator &( Test^ msg, int& i ) { i = i + 1; return nullptr; } }; and then looked at the compiler ...

Run a PHP script every second using CLI

Hello, I have a dedicated server running Cent OS with a Parallel PLESK panel. I need to run a php script every second, that updates my database. These is no alternative way timewise, i have checked every method, it needs to be updated every second. I can find my script using the url: http://www.mysite.com/phpfile.php?key=123, and this ...

Inspect network traffic from simple linux cli app

I'm running a small app on the command line, and I'm trying to watch the (http) network traffic it creates. Is there some kind of wrapper program (like 'time', or 'watch') which can display all network traffic to and from my app? (Or at least, make a copy of it in a file) ...

modify sql file on using command line on unix

I have a .sql file that needs a little tweaking, speficially: [xx_blah] any pattern like the above needs to be changed to: [Blah] i.e. remove the xx_prefix and upper case the next character. any tips? ...

Java commons-cli, options with list of possible values

How can I make an option accept only some specified values like in the following example: $ java -jar Mumu.jar -a foo OK $ java -jar Mumu.jar -a bar OK $ java -jar Mumu.jar -a foobar foobar is not a valid value for -a ...

Libraries to help implement a CLI in Ruby?

Hi, I'm trying to implement a CLI type application in Ruby. The CLI should accept commands using a grammar that I wish to define. I've found some leads on how to implement and parse a grammar (RParsec) but I don't see how I can hook that up to some code to acutally execute the command. Commands would be something like (very rough id...

C# Compilation without visual studio

I am learning C# and I know the advantages and ease of using Visual Studio but basically I want to learn the mechanics of C# the old school way. I understand that I need to the least .NET Framework and Notepad to compile C# code which I have already. Now I have created the small app as myApp.cs and I want to know how should I compile it ...

Musicbrainz fingerprinting

I've been busy with understanding the MusicBrainz database in the past few hours and as I noticed there's no command line application to tag or fingerprint audio files. Are there any CLI implementations on Musicbrainz's fingerprinting? And how can I create those fingerprints? I found some development tools on their website (python-music...

Python CLI to edit Firefox bookmarks ?

Has anyone done a Python CLI to edit Firefox bookmarks ? My worldview is that of Unix file trees; I want find /re/ in given or all fields in given or all subtrees cd ls with context mv this ../there/ Whether it uses bookamrks.html or places.sqlite is secondary -- whatever's easier. Clarification added: I'd be happy to quit Firefox, e...

Definition of when finally is executed

Possible Duplicates: Conditions when finally does not execute in a .net try..finally block In C# will the Finally block be executed in a try, catch, finally if an unhandled exception is thrown ? At http://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Java#Finally_Blocks_and_Uncaught_Exceptions Says that finally block dont r...

Finding baselines associated with a CR in the Telelogic Synergy command line

How would one find baselines associated with a CR in Telelogic Synergy using the CLI interface? I have tried ccm query "cvtype='baseline' and cr('xxx')", but this doesn't produce any results. From the GUI you can look at the properties of a baseline and see which CRs are associated with the baseline, but I can't seem to find the proper ...

PHP: Schedule scripts without using CRON

I know there are many posts about using CRON to run a php file. But, in the world of shared hosting, and ease of setup for a user, I don't want to have to mess with that. I found another solution online that has to do with sockets. Just wanted to get everyones take on this, and tell me if this is a good or bad idea. Sounds like it wo...

How to differentiate between http and cli requests?

The title is quiet straightforward. I have to know on server side if the script called through HTTP request or by command line. I could examine the $_SERVER['argv'] or $_SERVER['argc']. What is the pragmatic way to do that? ...

mysql cli: how to list all databases I have permisions to create/read/update/delete?

What command do I use on a mysql command line to see all the databases on some database server that I have permissions to? Specifically I am looking for the DBs that I have full CRUD permissions to. ...

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

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 ...

CLI-Based "V" in Rails MVC?

Having a hard time getting any useful results from various searches on this concept -- probably because it's a. Wrong and/or b. obscure. Essentially, though, I'd like to write an application which works as either a normal web app or with a command-line interface. I've done this in the ancient past for sysadmin-y stuff using Perl, but t...

How to set args when debugging a php cli file in zend studio?

In a prompt we can run: php filename.php args But how to set the args in zend studio? I've searched for this some time,and don't seems to find the example. I can only debug without args by simply pressing F5 ...