Documentations - SRON
  • SRON's Official Documentation
  • Installation
  • Syntax of SRON
  • Executing a SRON code
  • Keywords in SRON
  • Comments in SRON
  • Datatypes in SRON
  • Variables in SRON
  • Memory Ownership Model
  • Operators in SRON
  • Math block
  • if elif else in SRON
  • Loops in SRON
    • For Loop
    • While Loop
    • Foreach Loop
  • Break & Continue
  • Functions in SRON
    • Print functions
    • User Input Functions
    • Type Conversion functions
    • Type Checking functions
    • Math functions
    • Char Functions
    • String Functions
    • List Functions
    • Miscellaneous functions
  • Return in SRON
  • Command Line Arguments
  • Free
  • Rotate
  • Console
  • Sample codes
  • Coding Convention
  • Frequently Asked Questions
  • Credits
  • Contact
  • Donate
Powered by GitBook
On this page

Command Line Arguments

Command-line arguments are values or options that you can pass to a program when you launch it via command line(or terminal). They allow you to control the behavior of the program from outside, rather than hardcoding values directly into the code.

Before passing command-line arguments, the main function in your code must take one variable of type 'List'.

{
    name : MAIN
    args: (List __arglist)
    println("Arguments : ", __arglist)
}

After succesfull compilation of your source code, you can pass command line arguments like this:

INPUT

    sron 1 2 3 4 5

OUTPUT

Arguments : [1, 2, 3, 4, 5]

PreviousReturn in SRONNextFree

Last updated 6 months ago