Jump to content




How to allow for custom program arguments in shell.complete()


  • You cannot reply to this topic
5 replies to this topic

#1 cyanisaac

  • Members
  • 369 posts
  • LocationSan Diego, CA

Posted 30 July 2015 - 04:18 AM

Hi there!

shell.complete() seems to only allow arguments for a select few programs... Is there any way your programs can be built to have shell.complete() have completions for arguments, or at least general arguments (such as filepaths), or is there a way to add them in using code?

Or do I just have to redo shell.complete(), and if so, how the heck would you do that? :P

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 30 July 2015 - 04:53 AM

Yes, it's possible. See /rom/startup for usage examples.

#3 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 30 July 2015 - 05:58 AM

Luckily for you the wiki page has already been written for the function you'll need to use. shell.setCompletionFunction()

#4 cyanisaac

  • Members
  • 369 posts
  • LocationSan Diego, CA

Posted 31 July 2015 - 01:52 AM

How would you do file completions though, for instance, having my custom ls program have autocomplete for directories and files? Just wondering :P

#5 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 31 July 2015 - 01:59 AM

Perhaps with fs.complete? We do have a fairly good wiki. You should check it out some time.

#6 cyanisaac

  • Members
  • 369 posts
  • LocationSan Diego, CA

Posted 02 August 2015 - 12:52 AM

View PostLyqyd, on 31 July 2015 - 01:59 AM, said:

Perhaps with fs.complete? We do have a fairly good wiki. You should check it out some time.

Hehe you're funny, I do look at the wiki thankyouverymuch.

This didn't seem to work but I think it is an issue with my code, I will try this later. Thanks for the help :D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users