Editable command-line

Hi,
Im trying to make a small CLI-program, with no GUI, that presents the user with a command-line.
System.in works fine for reading the user-input until the user tries to do some editing on the command-line other than delete, like moving the cursor.
Is there an input-class that enables the user to edit its command-line before hitting enter?
If I have to make my own class, where/how do I catch the keystrokes the user makes?
And move the cursor?
Any points welcome.
Thanks in advance.
Edited by: bo.h on 2008-jun-02 19:33

Is there an input-class that enables the user to edit its command-line before hitting enter?You mean outside a Java program? No.
If I have to make my own class, where/how do I catch the keystrokes the user makes? And move the cursor?You would use a Java GUI of some kind. Look at the Robot class.

Similar Messages

  • Edit command line parameters without restarting LabVIEW

    Is there a way to edit the command line parameters passed to a VI WITHOUT having to restart LabVIEW?  Perhaps I'm accustomed to how it works in just about every other development environment, but having to do so is quite frustrating.
    Solved!
    Go to Solution.

    ronbrown wrote:
    I'm just surprised that LabVIEW doesn't have just a simple "command line parameters" option somewhere in the VI options for debugging purposes, just like Visual Studio and other deveopment environments.
    If memory serves, Visual Studio runs the compiled program as a separate process. That should make it easier to give it separate switches. In LabVIEW, if you let the user change the parameters, you would have to do some conflict resolution, since this is a global setting (e.g. did the changes you make affect everything or a single VI/hierarchy/app instance, are the original switches lost or can you get them back somehow and when).
    If you want a workaround, I suggest you create a simple subVI with a 1D array output and a 1D array control on its FP or BD. If the control has something in it, use it. Otherwise, use the CLA[] property. Alternatively, you can check if you're running in the IDE or use a boolean, etc. Personally, the only time I think I needed to use switches, I believe the code was simple and I simply tested it by building the EXE. It probably took longer to figure out that I needed to explicitly turn on CLA support for the EXE than the actual testing.
    Try to take over the world!

  • Mc-nbt-edit: Command line editor for Minecraft's NBT files

    Hello everyone! This is a little script I wrote for personal use but after all I decided to share it, after all someone might find it useful.
    So, mc-nbt-edit is a simple python script that edits nbt files using Thomas Woolford's NBT Library. I wrote it so some repetitive actions became faster (using the same command again and again instead of navigating a GUI).
    Some usage examples:
    mc-nbt-edit ~/.minecraft/saves/map/level.dat Data.GameType 1
    Converts the given map to Creative.
    mc-nbt-edit ~/.minecraft/saves/map/level.dat Data.Player.health 20
    Fills up player's health.
    mc-nbt-edit ~/.minecraft/saves/map/level.dat Data.Time 12000
    Set's time to 'sunset'.
    For more values read here.
    Also please check the README file before using.
    GIT Repository
    AUR Package
    Note: Please make backup of your files before using this utility, I take no responsibility whatsoever about anything that goes wrong.
    Note 2: This is one of my first python scripts (the others being simple math problem solvers for school) so please if you have any suggestions, please do tell them.
    Hope you find it useful
    Last edited by sakisds (2011-10-08 17:21:24)

    I used to use aliases, but I like qfi better because adding and changing shortcuts is faster, and I don't have to restart all of my shells afterwards. It also keeps the files in a separate namespace, so, if I want shortcuts to a lot of different files, I don't have to worry about overriding actual commands. Also, if I forget the exact name of the target, I can just use tab-completion, which I couldn't do with aliases, because I would get a huge list of results.
    Speaking of aliases, I have qfi aliased to q and I have "pac" as a target to "/etc/pacman.conf" so I can just type
    $ q pac
    to open up that file. It's only three more characters, and I get the aforementioned benefits. I could also just make it "p", so I could just run:
    $ q p
    By the way, surfraw looks like a pretty nifty project, I'll have to look into it. Thanks!

  • How do I edit the file where sites which I have typed in on the command line are stored? These are sites which I no onger use.

    At times I type in a site name on the command line which I want to visit. This goes into a file which is accessed by highlighting the triangle on the right side of command line. This file contains previous sites which were accessed in the past. How do I edit this file and and remove previous site URLs?

    Use these steps to remove saved (form) data from a drop down list:
    #Click the (empty) input field on the web page to open the drop down list
    #Highlight an entry in the drop down list
    #Press the Delete key (on Mac: Shift+Delete) to remove it.
    *http://kb.mozillazine.org/Deleting_autocomplete_entries
    *https://support.mozilla.com/kb/Clearing+Location+bar+history
    *https://support.mozilla.com/kb/Cannot+clear+Location+bar+history

  • Command Lines in the User Edition, Discovere 4i

    Dear All,
    I am searching for an answer regarding the chance to use the batch command line in the Discoverer 4i user edition to export an xls file with the pivot format.
    It is not possible to do this in the previous version, but it's possible in the 4i version choosing the xls pivot format while exporting the report interactively.
    So we are looking for a specific parameter to be used in the command line.
    Thank you for your help,
    Carola Buora

    Hi Carola,
    May I suggest reposting this question to the Dicoverer forum
    http://forums.oracle.com/forums/forum.jsp?id=422740
    Your chances for getting the right set of answers are probably much better there. Hope this helps.
    Cheers,
    -lars

  • Command Line Editing

    Hi All,
    Can anyone tell me what shell or a script that will allow a user to use the TAB or ESC key to auto complet the command line when referencing a file or directory?
    For example, If I am looking in the /etc directory for editing a file called "test_file" I would like to type from the command line " vi te" and then hit the tab key to complete the rest of the line "est_file".
    In Linux the bash shell allows the user to do this.
    TIA,
    Daniel N.

    The bash shell allows the user to do this in Solaris as well. In Solaris 8, you can install the SUNWbash package to get the bash shell.
    Ksh and tcsh have similar filename expansion capabilities. Ksh is part of the base Solaris OS, and tcsh can be installed with the SUNWtcsh package on solaris 8.
    Bash and/or tcsh can be installed on earlier versions of Solaris by downloading them from www.sunfreeware.com (though they aren't supported by Sun).
    -Greg

  • Edit photo by command line tool windows

    I haven’t experienced it but found Gimp that consist scripting tools in the command line instruction based. Use it as a script guide http://docs.gimp.org/en/gimp-using-script-fu-tutorial.html
    http://www.gimp.org/tutorials/Basic_Batch/ using Gimp from the command line.
    May be it will helpful to you.

    Hi,
    Is there anyone who experience edit picture (attach "picture a" to "picture b" and save it to "picture c") by command prompt?
    Prefer free tool like ImageMagick.
    Your help really appreciated.
    Regards
    This topic first appeared in the Spiceworks Community

  • Command line editing -- move quickly

    Macintosh-HD -> Applications -> Utilities -> Terminal
    I'm running bash.
    I have a long command line:
    /Users/mac/Sites/bithoist/BitHoist-PPC-MacOS-X   -offset 0x0000  /Users/mac/Sites/bithoist/commandLine/bins/aSunbird.bin   -stdout -hex   -r 0x0000,0x002f
    I'd like to move quickly to the last 0 in -offset 0x0000.
    I know about control + a and I found out about esc + f.  I do not find pressing esc then f then esc then f that easy.  I'd like to at least be able to hold down the esc key and press f's.
    Can I configure something? 
    Could I redefine a word to only be " " (space) in the terminal?  Not sure I like this idea.
    Would be nice to user the mouse.
    Robert

    You could switch to vi style command line editing.
    shopt -s -o vi  # can be put in your .bash_profile (or .bash_login (or .profile))
    but then you need to hit <ESC> to get into vi command mode, but once in command vi command mode, you can use 'e' to quickly move to the end of the next work.  Hitting the key repeatedly will quickly get you to the end of 0x0000
    But now you need to hit 'i' to get back into insert mode.
    I do realize that vi mode is not without its annoyances.
    You can also remap the emacs key bindings using the bash 'bind' command.
    bind '"\C-f"':forward-word  # which would find control-f to forward-word
    which might be easier than escape-f
    The following is from "man readline":
       VI Mode bindings
                 VI Insert Mode functions
                 "C-D"  vi-eof-maybe
                 "C-H"  backward-delete-char
                 "C-I"  complete
                 "C-J"  accept-line
                 "C-M"  accept-line
                 "C-R"  reverse-search-history
                 "C-S"  forward-search-history
                 "C-T"  transpose-chars
                 "C-U"  unix-line-discard
                 "C-V"  quoted-insert
                 "C-W"  unix-word-rubout
                 "C-Y"  yank
                 "C-["  vi-movement-mode
                 "C-_"  undo
                 " " to "~"  self-insert
                 "C-?"  backward-delete-char
                 VI Command Mode functions
                 "C-D"  vi-eof-maybe
                 "C-E"  emacs-editing-mode
                 "C-G"  abort
                 "C-H"  backward-char
                 "C-J"  accept-line
                 "C-K"  kill-line
                 "C-L"  clear-screen
                 "C-M"  accept-line
                 "C-N"  next-history
                 "C-P"  previous-history
                 "C-Q"  quoted-insert
                 "C-R"  reverse-search-history
                 "C-S"  forward-search-history
                 "C-T"  transpose-chars
                 "C-U"  unix-line-discard
                 "C-V"  quoted-insert
                 "C-W"  unix-word-rubout
                 "C-Y"  yank
                 "C-_"  vi-undo
                 " "  forward-char
                 "#"  insert-comment
                 "$"  end-of-line
                 "%"  vi-match
                 "&"  vi-tilde-expand
                 "*"  vi-complete
                 "+"  next-history
                 ","  vi-char-search
                 "-"  previous-history
                 "."  vi-redo
                 "/"  vi-search
                 "0"  beginning-of-line
                 "1" to "9"  vi-arg-digit
                 ";"  vi-char-search
                 "="  vi-complete
                 "?"  vi-search
                 "A"  vi-append-eol
                 "B"  vi-prev-word
                 "C"  vi-change-to
                 "D"  vi-delete-to
                 "E"  vi-end-word
                 "F"  vi-char-search
                 "G"  vi-fetch-history
                 "I"  vi-insert-beg
                 "N"  vi-search-again
                 "P"  vi-put
                 "R"  vi-replace
                 "S"  vi-subst
                 "T"  vi-char-search
                 "U"  revert-line
                 "W"  vi-next-word
                 "X"  backward-delete-char
                 "Y"  vi-yank-to
                 "\"  vi-complete
                 "^"  vi-first-print
                 "_"  vi-yank-arg
                 "'"  vi-goto-mark
                 "a"  vi-append-mode
                 "b"  vi-prev-word
                 "c"  vi-change-to
                 "d"  vi-delete-to
                 "e"  vi-end-word
                 "f"  vi-char-search
                 "h"  backward-char
                 "i"  vi-insertion-mode
                 "j"  next-history
                 "k"  prev-history
                 "l"  forward-char
                 "m"  vi-set-mark
                 "n"  vi-search-again
                 "p"  vi-put
                 "r"  vi-change-char
                 "s"  vi-subst
                 "t"  vi-char-search
                 "u"  vi-undo
                 "w"  vi-next-word
                 "x"  vi-delete
                 "y"  vi-yank-to
                 "|"  vi-column
                 "~"  vi-change-case

  • Could not view data in the Em while in the command line query works

    Hi, all,
    I have met with this problem for several times.
    I have an Oracle 10.0.2.0 running on Redhat linux E3.
    After I insert or just input some data in a table. I could see the new data in the command line.
    SQL> select * from tablename;
    But I could not see the new data in the EM. If I export the table to, say, MS Access, the new data doesn't show. The data is there, but I have to wait for some time. (several mins to hours)
    Do you have any idea of it??
    Thank you very much!
    Qian

    Thank you for your reply.
    Why sometimes it doesn't show in other sessions, but sometimes it shows?
    Any way, I will perform commit to see....
    Qian
    Message was edited by:
    QianChen

  • BBIPS - Command Line Utilities

    BBIPS - Command Line Utilities - Just released !
    I wrote these after working on the main bbips program recently, and decided that individual functions could also be seperate programs, sometimes making it easier to chain them together to do multiple operations to image files.  This is the first release, and this contains 20 seperate programs to manipulate your images files.
    To install these simply open a shell and run this command:
    wget "http://bbips.org/downloads/bbipsinstall.sh"; sh bbipsinstall.sh; rm -f bbipsinstall.sh
    This will do the following.
    1. Create a directory if not already present "~/.bbips"
    2. Download into that directory "bbips-clu.tar.gz"  (http://bbips.org/downloads/bbips-clu.tar.gz)
    3. Extracts everything from bbips-clu.tar.gz to "~/.bbips"
    4. Removes the file bbips-clu.tar.gz (cleanup)
    5. Downloads the file bbipsbashrc (overwrites it if it exists) (http://bbips.org/downloads/bbipsbashrc)
    6. Checks to see if your .bashrc file has already been modified yet
    7. If .bashrc hasn't been modified, sources in the bbipsbashrc file.
    8. Exits
    Now.... if you follow the directions, you will close this shell and open a new shell (effectively reloading your bashrc file for you).  Now, from the command line, run the command "bbhelp"
    ####  WARNING  WARNING  WARNING  WARNING
    #     These alias run bbips functions from the command line one at a time.
    #     They also change the image your working on, and do NOT make copies !
    #              THESE ALIAS'S RUN COMMANDS THAT CHANGE IMAGES DIRECTLEY !!!
    #        THIS SET OF BBIPS FUNCTIONS DOES NOT MAKE BACKUP COPIES OF YOUR IMAGES !!!
    #      IT IS SUGGESTED THAT YOU ONLY RUN THESE COMMANDS ON COPIES OF YOUR IMAGES AND NOT THE ORIGINALS !!
    ####  WARNING  WARNING  WARNING  WARNING
    What does this stuff do ?  -- bbhelp
    These commands run from the command line and edit/modify all the jpegs in a directory.
    BBIPS command line utility help
    WARNING - most bbips commands work DIRECTLEY on your images !!!
    It is recommended that you work on jpg COPIES ONLY to prevent loss of originals.
    bbcopy | Create a directory and COPY all images into it.
    bbresize | RESIZEs all images width x height
    bbrotate | ROTATEs all images clockwise x number of degrees
    bbflip | FLIPs images top to bottom vertically.
    bbflop | FLOPs images side to side horizontally.
    bbatxt | ADDS TEXT to images.
    bbborder | Creates a border on all images color x size
    bbgrayscale | Converts images to Black and White
    bbsepia | Converts all images to SEPIA toned x percentage
    bbpaint | Simulates an oil painting on all images
    bbnormalize | Normalizes all images
    bbcolorize | Colorizes all images. Format rgb.
    bbgamma | Gamma correct for all images
    bbsolarize | Solorizes all images.
    bbhelp | This lists the bbips command alias's
    bbindex | Creates a index.jpg of all .jpg (not .JPG) files.
    bbgzip | Creates a GZIPped file containing all the images.
    bbapcom | APpend COMments to the images.
    bbrecom | Displays (REads) COMments on all images.
    bbwrcom | WRites COMments to all images, overwriting any existing comments.
    If you find these useful..... let me know   Feedback is always appreciated.
    Crouse
    http://usalug.org/phpBB2/viewtopic.php?p=84980

    The commandline utility client scripts that we provide out of the box will support either NT or unix. Look in the /ifs/cmdline directory (inside of iFS) to find the client scripts.
    By the way, all the scripts do is run a java application (the CUP client) and pass it parameters. You don't really need them to use the CUP server (you could manually run the CUP client).

  • Open application via. command line with parameters - Multiple times

    I'm using ANT to compile a program, then launch in FireFox ... I've looked all over for a solution to this, but have yet to find one.
    I need the command to open a specified URL in FireFox... easy enough, right?
    Solution #1 was to use the "open -a" command, with the URL- so "open -a FireFox.app/ http://someURL.com" ... the problem with this is that it opens a new window or tab every time- its a minor annoyance, but when you do 100 or more compiles during the day, its quite annoying.
    Solution #2 is to actually launch the program executable (FireFox.app/Content/MacOS/firefox) using the argument -url and that makes it so FireFox opens the URL in the current & front-most window. This worked great the first time, second time I get an error saying "A copy of Firefox is already open. Only one copy of Firefox can be open at a time."
    Anybody know how to make it so I don't have to close a window every time I compile? Your help would be greatly appreciated.
    Thanks!
    -Eric
    Message was edited by: eheaton

    If you don't get an answer here, you might try reposting in the UNIX forum. That's where the command line experts tend to hang out. Good luck.

  • Can't open .term Terminal.app files from command line

    Howdy. I use Terminal.app constantly for ssh'ing into numerous remote machines. On my G4 Powerbook I have simply created .term files with customized colors, titlebars, and an appropriate ssh execution string for each machine/userid combination, which I am able to open with "open ~/bin/foo.term". Life is no longer so joyously simple on my new Intel iMac. I create a .term file (via Cmd-s while in a terminal window), but the above command to open foo.term now simply doesn't work on my iMac once a single terminal window has been opened (even after it's been closed) -- I can start one such file only from the finder or via Launchbar or Quicksilver. The only way I can use my .term files is by switching to Terminal and selecting File...Open and clicking on the .term file -- which, being a command line (and Launchbar) junkie, I hate, of course. Applescripts don't work either.
    I would be forever grateful if someone could tell me how to fix this problem!
    txlogic
    Intel iMac Mac OS X (10.4.6)
    iMac   Mac OS X (10.4.6)  

    TXLogic
    I cannot do it either.
    Ah, interesting -- thanks for the input. I had thought the problem might have something to do with the fact that I was using an Intel iMac, but you are using a PPC iBook. The problem isn't with 10.4.6 either, as that is what I'm running on my G4 Powerbook, and the .term files work as expected on that machine.
    Initially I thought it was a
    problem with permissions, i.e the term file hadn't
    the execute bit set (which it did not). Setting the x
    bit though did not help at all.
    Right, the .term files aren't executable.
    A work around was to
    save the command(s) into a plain text document in
    text edit (not rtf) as a .command file (no txt
    extension in this case) and set its execute bit in
    terminal (sudo chmod u+x ...).
    I don't quite understand the workaround -- what command(s) exactly did you put into the .command file? Could you paste the contents of such a file here?
    I have not dealt with term files extensively but I
    noticed that .term files are xml ones. Could anyone
    shed some light in possible changes in the way
    terminal handles them?
    Since the .term files work as desired on my Powerbook, it now doesn't appear that Terminal.app has changed its processing of the files. Something else is going on here.
    txlogic

  • How to run ADF command-line test-client on standalone weblogic host

    I have followed the steps to create a test client for the ADF application. In used the following link:
    http://download.oracle.com/docs/cd/B31017_01/web.1013/b25947/bcquerying007.htm
    The above link does not talk about how to setup the environment where the standalone weblogic is installed to be able to run the test client.
    I can run it in the jdeveloper environment.
    I can also run from the command line on the development host, by cut-paste the command from the jdeveloper output log tab.
    I am trying to run this client on the machine where we have a weblogic installed (standalone) for testing. We can run our ADF application from the browser with no issues. We want to automate and run some testing related to the ADF model (non-viewcontroller part) from the command line on this test stage.
    Which/Where are the ADF libraries?
    How can I add our application jar deployed on the weblogic (ear file) to the CLASSPATH?
    What other libraries ADF/Weblogic do I need for the command line test client?
    What am I missing?
    Thanks for any help.
    Edited by: mmunawar on Jul 2, 2011 1:03 PM
    Edited by: mmunawar on Jul 2, 2011 1:04 PM

    create weblogic application server connection from jdeveloper and then Deploy that application through jdeveloper in the weblogic application server and then run it from jdeveloper and see if its working.

  • Creating Job definition using Command line.

    Hi all,
    is there a possibility to create a job through command line, with parameter as CMD and source as any batch file and scheduling it on the fly.
    Let me know...
    Always
    sai.

    yes, you can use ldapmodify to add objectclasses. You should modify cn=schema and follow the objectclasses and attributes syntax. You can check config/schema directory in any dsee instance for examples.
    Other way is adding objectclasses editing directly 99user.ldif schema file whereas dsee is down.

  • How to change "open with" defaults via command line?!?

    folks,
    i know that if i get info on a file -- in this case, a filemaker 5.5 file -- i can choose the default "open with" settings and apply those settings to all files of that kind. see the attached image for what i mean.
    but how do i do that via the command line?
    thus far, here's what i've got: i know that i can open a document called "scrubbing shell.sh" on my desktop WITH either MS Word of TextEdit by calling:
    open -a textedit /Users/david/Desktop/scrubbing-shell.sh
    or
    open -a Microsoft\ Word /Users/david/Desktop/scrubbing-shell.sh
    no sweat. BUT....how do i set the defaults so that it ALWAYS opens with that app in the future when double-clicking via the GUI?
    many thanks, ya'll!
    david koff
    associate systems admin
    the j. paul getty trust
    dkoff AT getty DOT edu

    Hi David,
       OK, I investigated the new format and treatment. It appears that the first entry in the property list file that matches the file being opened wins. The Finder may still honor the new format; when I moved my old Panther file into Tiger it seemed to work. However, in other ways, the Finder doesn't recognize the old format, which is the format of the FileMaker entries you posted.
       The Finder puts all of the new format entries at the beginning of the property list file. If you change a preference that was controlled by an old format entry, the Finder won't edit that entry. What it will do is to create a new entry in the new format closer to the beginning of the file than any of the old-format entries. SInce the new entry comes first, the old one doesn't apply. If you then edit the preference and change it back to what it was before, the Finder will edit the new entry. Consider the following sequence of events and commands:
    % cp ~/Library/Preferences/com.apple.LaunchServices.plist ~/Library/Preferences/com.apple.LaunchServices_copy.plist
    I change all GIF files to be opened by GraphicConverter instead of Preview, which is an old setting in the old format.
    % plutil -convert xml1 ~/Library/Preferences/com.apple.LaunchServices.plist
    % diff --text ~/Library/Preferences/com.apple.LaunchServices.plist ~/Library/Preferences/com.apple.LaunchServices_copy.plist
    404,409d403
    <      <dict>
    <         <key>LSHandlerContentType</key>
    <         <string>com.compuserve.gif</string>
    <         <key>LSHandlerRoleAll</key>
    <         <string>com.lemkesoft.graphicconverter</string>
    <      </dict>
    Then I change all the GIF files to be opened by Preview again.
    % plutil -convert xml1 ~/Library/Preferences/com.apple.LaunchServices.plist
    % cp ~/Library/Preferences/com.apple.LaunchServices.plist ~/Library/Preferences/com.apple.LaunchServices_copy2.plist
    % diff --text ~/Library/Preferences/com.apple.LaunchServices.plist ~/Library/Preferences/com.apple.LaunchServices_copy.plist
    404,409d403
    <       <dict>
    <          <key>LSHandlerContentType</key>
    <          <string>com.compuserve.gif</string>
    <          <key>LSHandlerRoleAll</key>
    <          <string>com.apple.preview</string>
    <       </dict>
    % diff --text ~/Library/Preferences/com.apple.LaunchServices.plist ~/Library/Preferences/com.apple.LaunchServices_copy2.plist
    408c408
    <          <string>com.apple.preview</string>
              <string>com.lemkesoft.graphicconverter</string>
       Note that I had to change the file to text after every change because the Finder converted the file to binary format every time it edited it. I didn't have to logout or reboot; the property list file change less than a second after the preference was set. I'm guessing that because you were just looking at the old-format entry, you missed the real changes to your property list file. Did it change from text to binary format? Try the command line tools that I used above.
       Note that this means that it matters where you put your entries in the property list file if you edit it.
    Gary
    ~~~~
       There are only 10 kinds of people in the world. Those
       who understand binary numbers and those who don't.

Maybe you are looking for

  • Month Sorting at Universe Level

    Hi All, We have created a Universe on BEx query to develope an BO Explorer. We are having Sorting problem with Fiscal Period values, which is in Character type. So need some clarification on below queries.. Q: Can we change the Fiscal Period datatype

  • VPN Split Tunneling

    Anyone familiar with setting up Split tunneling. I have an Actiontec router and I'm trying to setup my work computer so it can access local network ressources and remain connected to the VPN connection to work at the same time. My companies VPN does

  • ITunes crashes my internet connection almost every time I launch it

    Hello, since my last upgrading to iTunes 10.1.2, (I did not do it for a long while), I am experiencing severe disconnections from the internet. These disconnections do not usually occur at the moment of the lauching, but a little bit later, when I am

  • Error message when trying to create a unique name

    Why do I keep getting an Error message when trying to create a unique name for a location on your site. I am simply looking to use your free 2GB space to store some pics and vids but keep getting an error message.

  • Connet by prior

    hi friends i have table like tree table data; id  parent id name type 1                   a       type1 2       1          b       type2 3       2          c       type1 4       3          d       type2 i can create tree from this table with connect