• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

discover Runtime program list / exec autocomplete

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm currently experimenting to create a console application that can emulate a shell environment. I'm stuck with COMMAND AUTO COMPLETION!

I can execute commands on runtime via


Obviously, the command I want to execute must be in the PATH.
but how can I get a list of all available commands in this PATH? I've got the code to do auto completion if I have got all possible command in a List. But I don't know how to populate this list (easily?)

Is there no other way to do this, other than actually scouring the directories and looking for executables name (i.e indexing them beforehand?)

Is it possible to reuse the auto-completion facility that the shell have already? I.e sending a keyboard <tab> into the shell from the java program and obtaining the result back?

Sorry been doing too much Java EE so my GUI skills need some brushing up.

Thanks for your help.

Regards,
Zen
[ November 28, 2007: Message edited by: Bear Bibeault ]
 
That feels good. Thanks. Here's a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic