runnr


Namerunnr JSON
Version 0.2.1 PyPI version JSON
download
home_page
Summaryrunnr is an open-source command line interface tool for building, compiling & executing different programs & files.
upload_time2023-10-24 14:25:40
maintainer
docs_urlNone
authorAniket Biswas
requires_python>=3.10
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # runnr
runnr is an open-source command line interface tool for building, compiling & executing different programs & files.A single powerfull tool for developers to compile, open, build & interpret different programs.

runnr is currently in Beta stages [v0.x.x], most of the important features will be added in stable realease version [v1.x.x].
# Installation

[Link to PyPi](https://pypi.org/project/runnr/)

Install runnr with pip:
```bash
pip install runnr
```
    
# Documentation

- ## Config File:

Before starting to compiling & executing anything, lets take a look at runnr.conf file present at:-
```bash
Windows: C:\Users\<user-name>\runnr.conf
Unix-like: ~\.config\runnr.conf
```

>If config file is not present the try running: runnr --version

This runnr.conf is the main config file that runnr use to execute commands based on file-extension. Once the configuration is set for any file-extension runnr can execute and run it without any problem. As runnr is a config file based tool, it is very easy to use the same config file in different system only after setting it up once.

- ### Syntax of the config file:

```
(<extension>) :: <arguemnt1> = "<parameter1>",  <arguemnt2> = "<parameter2>", ....
```
All `<argument> = <parameter>` are separateed using ','. You can even comment in this config file using '#' and white Spaces are ignored automatically.

- Example:

```
#for adding support for .c files, we simply can write:-
(.c) :: COMPILER = "gcc", OUTPUT_FILENAME="$FILE"
```

The extension must be enclosed withing parenthese: "()". Then the respective arguments & parameters are writen after using argument separator: "::". The arguments must be separated using "," and every argument must have its value/parameter enclosed withing double qoutes: "".

- ## Supported Arguments:
As of version: v0.2.0 suppported aruments are:

```
1. COMPILER="<compiler-name>"
2. INTERPRETER="<interpreter-name>"
3. USE=<cli-program> : It is used for special arguments like "-open"
4. OUTPUT_FILENAME=<variables or name> : It is used for setting special output name.
```

- ### Output Name Values:
```
$FILE : It sets the output name to be same as input file name but without the extension.
$NONE : It is mostly used for interpreter based languages, as those don't have any compiled file.
        Using $NONE on compiled based languages, turns off generation of any custom output file.

<any-custom-name> : Creates an output file with the given name.
```
- Examples:
```
#for javascript
(.js)::INTERPRETER="node", OUTPUT_FILENAME="$NONE"
```

For interpreter based languages, it is optional to set "OUTPUT_FILENAME" argument.

- ## CLI Tool:
Now lets see how to interact with the runnr tool :- 

First lets see if it installed or not? : Simply Type-
```bash
$ runnr --version
v0.x.x
```

>If any error occurs then install runnr first.
>If it prompts to create config file, enter "Y". Then retry with the command.

Now if it is installed correctly, lets proceed with its usages:-

- ### Comiling or Interpreting a file:
runnr can compile or interpret different programs based on extensions from "runnr.conf" file. Now lets see some examples. Suppose we have "hello.py" & "hello.cpp" file with "Hello, World" printing program.

Then to run this files:
``` bash
$ runnr hello.py
Hello, World
```


```bash
$ runnr hello.cpp
Hello, World
```

It can execute different files based on .conf file.
* It is important to note that the file that is being compiled/interpreted must be the last argument, after any options.

- ### Only compiling not executing:
We can make runnr to only compile a programs but not execute it by using '-run' option.

Example:
```bash
$ runnr -run N hello.cpp
```

It outputs nothing as we set running after compilation to off. It just generates the binary executable file.

This option only works for compiled based programs like C, C++, rust. The "-run" option's parameter can be either "Y" or "N".

- ### Custom output file name for Compiled programs:

We can make runnr to output the compiled executable file-name as we want it to be instead of default set value from config.

Examples:
```bash
$ runnr -run N -out helloworld hello.cpp
$ ./helloworld
Hello, World
```
>Yes, we can use these different options and parameters all together.
So, "-out" option takes only one parameter that is the file name of the output file.

- ### More compiler arguments:
There may be some cases where we need to pass more compiler arguemnts to compile it. For example, in C++ we might need to tell the compiler to use C++11, as we have used 'auto' data-type in out program. 

This can be achieved by two ways:

- Parmanent:
Modifying the "runnr.conf" file for ".cpp" extension.

Examples:
```
#this will use C++11 std library
(.cpp)::COMPILER="g++ -std=c++11", OUTPUT_FILENAME="a.out"
```

- Temporary:
For single file use cases.

Examples:
```bash
$ runnr -param "-std=c++11" -out helloworld hello.cpp
```

"-param" takes the compiler arguemnt and directly pass it to the compiler. It is also a good practice to wrap them in "". "-param" can also be used to link to libaries too.

```bash
$ runnr -param -lm -out sqrt square_root.c
```

- ### Execuable file's command-line arguemnts:
You might write some programs that takes command line arguments directly, as runnr can compile and execute simultaneously, you might want to pass the necessary arguments to the program. This can be achieved by using "-args".

Suppose we have written a program which takes 2 number directly from command line like "./a.exe 5 7" & outputs its sum. Lets see how to do that with runnr.

Examples:

```bash
$ runnr -args "5 7" sum_2_no.c
12
```

Again it is necessary to wrap the arguments within "" as it containes spaces.

- ### Executing multiple files at once:
Multiple different or same files can be executed simultaneously using "-files" option.

```bash
$ runnr -run N -files hello.c hello.py hello.cpp sum.c
```

- By default all the input files gets executed. Use `-run N` to turn it off for compiled based language.
- If any custom output file-name in set in the config or by using `-out` option, it will be ignored and the executable output name will be same as of the file-name without the extension.
- After "-files" option all the arguments must be files.
- For using "-args" option, all the executable will recieve same command-line argument.
- "-param" option is ignored while using "-files", otherwise it will result in passing of same compiler/interpreter parameter to different compiler/interpreter. It is recommended to set these parameter options in config-file instead.
- Opening of multiple files using "-open" isn't implemented yet.

- ### Debug:

Sometimes developers need to see what is actually getting executed by runnr to find any error or mis-compilation of programs & executions. To solve this a particular option is to be used called "-debug".

Examples:
```bash
$ runnr -debug -out helloworld -param "-std=c++11" hello.cpp
runnr: debug: config: using config from /Users/aniket/.config/runnr.conf
runnr: debug: executed: g++ -std=c++11 -o helloworld hello.cpp
runnr: debug: run: ./helloworld
Hello, World
```

Using the "-debug" gives a detailed output of the underneath commands execution.

- ### Version:
To check the version of runnr:

```bash
$ runnr --version
v0.x.x
$ runnr -V
v0.x.x
```

- ### Help:

```bash
$ runnr --help
$ runnr -h
```

- ## Update:
Update runnr using `--update or -U` option. It uses pip to update itself.
```bash
$ runnr --update
$ runnr -U
```

# VERSION:
- Version rule :: `<major>.<minor>.<patches>`
>v0.2.1

# What's New in this Update:

1. Added help option "--help" or "-h".
2. Added "--update" or "-U" option to automatically update runnr using pip.
3. Added option "-files" for compiling/interpreting multiple files at once.
4. Fixed the issue where runnr detects the single argument as file with no extension.
5. Fixed the issue where runnr ignore cli arguments for interpreted languages.
6. Removed auto copying of "runnr.conf" while building the "setup.py".
7. Removed unnecessary boolean variables from runnr_flags and replaced them with string operations.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "runnr",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "",
    "author": "Aniket Biswas",
    "author_email": "Aniket Biswas <contact.aniket.biswas@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/e9/ac/7a82e9a68feb206fe9fbb667073e7e5066c309d1ebb69dd73e86de58f9f5/runnr-0.2.1.tar.gz",
    "platform": null,
    "description": "# runnr\nrunnr is an open-source command line interface tool for building, compiling & executing different programs & files.A single powerfull tool for developers to compile, open, build & interpret different programs.\n\nrunnr is currently in Beta stages [v0.x.x], most of the important features will be added in stable realease version [v1.x.x].\n# Installation\n\n[Link to PyPi](https://pypi.org/project/runnr/)\n\nInstall runnr with pip:\n```bash\npip install runnr\n```\n    \n# Documentation\n\n- ## Config File:\n\nBefore starting to compiling & executing anything, lets take a look at runnr.conf file present at:-\n```bash\nWindows: C:\\Users\\<user-name>\\runnr.conf\nUnix-like: ~\\.config\\runnr.conf\n```\n\n>If config file is not present the try running: runnr --version\n\nThis runnr.conf is the main config file that runnr use to execute commands based on file-extension. Once the configuration is set for any file-extension runnr can execute and run it without any problem. As runnr is a config file based tool, it is very easy to use the same config file in different system only after setting it up once.\n\n- ### Syntax of the config file:\n\n```\n(<extension>) :: <arguemnt1> = \"<parameter1>\",  <arguemnt2> = \"<parameter2>\", ....\n```\nAll `<argument> = <parameter>` are separateed using ','. You can even comment in this config file using '#' and white Spaces are ignored automatically.\n\n- Example:\n\n```\n#for adding support for .c files, we simply can write:-\n(.c) :: COMPILER = \"gcc\", OUTPUT_FILENAME=\"$FILE\"\n```\n\nThe extension must be enclosed withing parenthese: \"()\". Then the respective arguments & parameters are writen after using argument separator: \"::\". The arguments must be separated using \",\" and every argument must have its value/parameter enclosed withing double qoutes: \"\".\n\n- ## Supported Arguments:\nAs of version: v0.2.0 suppported aruments are:\n\n```\n1. COMPILER=\"<compiler-name>\"\n2. INTERPRETER=\"<interpreter-name>\"\n3. USE=<cli-program> : It is used for special arguments like \"-open\"\n4. OUTPUT_FILENAME=<variables or name> : It is used for setting special output name.\n```\n\n- ### Output Name Values:\n```\n$FILE : It sets the output name to be same as input file name but without the extension.\n$NONE : It is mostly used for interpreter based languages, as those don't have any compiled file.\n        Using $NONE on compiled based languages, turns off generation of any custom output file.\n\n<any-custom-name> : Creates an output file with the given name.\n```\n- Examples:\n```\n#for javascript\n(.js)::INTERPRETER=\"node\", OUTPUT_FILENAME=\"$NONE\"\n```\n\nFor interpreter based languages, it is optional to set \"OUTPUT_FILENAME\" argument.\n\n- ## CLI Tool:\nNow lets see how to interact with the runnr tool :- \n\nFirst lets see if it installed or not? : Simply Type-\n```bash\n$ runnr --version\nv0.x.x\n```\n\n>If any error occurs then install runnr first.\n>If it prompts to create config file, enter \"Y\". Then retry with the command.\n\nNow if it is installed correctly, lets proceed with its usages:-\n\n- ### Comiling or Interpreting a file:\nrunnr can compile or interpret different programs based on extensions from \"runnr.conf\" file. Now lets see some examples. Suppose we have \"hello.py\" & \"hello.cpp\" file with \"Hello, World\" printing program.\n\nThen to run this files:\n``` bash\n$ runnr hello.py\nHello, World\n```\n\n\n```bash\n$ runnr hello.cpp\nHello, World\n```\n\nIt can execute different files based on .conf file.\n* It is important to note that the file that is being compiled/interpreted must be the last argument, after any options.\n\n- ### Only compiling not executing:\nWe can make runnr to only compile a programs but not execute it by using '-run' option.\n\nExample:\n```bash\n$ runnr -run N hello.cpp\n```\n\nIt outputs nothing as we set running after compilation to off. It just generates the binary executable file.\n\nThis option only works for compiled based programs like C, C++, rust. The \"-run\" option's parameter can be either \"Y\" or \"N\".\n\n- ### Custom output file name for Compiled programs:\n\nWe can make runnr to output the compiled executable file-name as we want it to be instead of default set value from config.\n\nExamples:\n```bash\n$ runnr -run N -out helloworld hello.cpp\n$ ./helloworld\nHello, World\n```\n>Yes, we can use these different options and parameters all together.\nSo, \"-out\" option takes only one parameter that is the file name of the output file.\n\n- ### More compiler arguments:\nThere may be some cases where we need to pass more compiler arguemnts to compile it. For example, in C++ we might need to tell the compiler to use C++11, as we have used 'auto' data-type in out program. \n\nThis can be achieved by two ways:\n\n- Parmanent:\nModifying the \"runnr.conf\" file for \".cpp\" extension.\n\nExamples:\n```\n#this will use C++11 std library\n(.cpp)::COMPILER=\"g++ -std=c++11\", OUTPUT_FILENAME=\"a.out\"\n```\n\n- Temporary:\nFor single file use cases.\n\nExamples:\n```bash\n$ runnr -param \"-std=c++11\" -out helloworld hello.cpp\n```\n\n\"-param\" takes the compiler arguemnt and directly pass it to the compiler. It is also a good practice to wrap them in \"\". \"-param\" can also be used to link to libaries too.\n\n```bash\n$ runnr -param -lm -out sqrt square_root.c\n```\n\n- ### Execuable file's command-line arguemnts:\nYou might write some programs that takes command line arguments directly, as runnr can compile and execute simultaneously, you might want to pass the necessary arguments to the program. This can be achieved by using \"-args\".\n\nSuppose we have written a program which takes 2 number directly from command line like \"./a.exe 5 7\" & outputs its sum. Lets see how to do that with runnr.\n\nExamples:\n\n```bash\n$ runnr -args \"5 7\" sum_2_no.c\n12\n```\n\nAgain it is necessary to wrap the arguments within \"\" as it containes spaces.\n\n- ### Executing multiple files at once:\nMultiple different or same files can be executed simultaneously using \"-files\" option.\n\n```bash\n$ runnr -run N -files hello.c hello.py hello.cpp sum.c\n```\n\n- By default all the input files gets executed. Use `-run N` to turn it off for compiled based language.\n- If any custom output file-name in set in the config or by using `-out` option, it will be ignored and the executable output name will be same as of the file-name without the extension.\n- After \"-files\" option all the arguments must be files.\n- For using \"-args\" option, all the executable will recieve same command-line argument.\n- \"-param\" option is ignored while using \"-files\", otherwise it will result in passing of same compiler/interpreter parameter to different compiler/interpreter. It is recommended to set these parameter options in config-file instead.\n- Opening of multiple files using \"-open\" isn't implemented yet.\n\n- ### Debug:\n\nSometimes developers need to see what is actually getting executed by runnr to find any error or mis-compilation of programs & executions. To solve this a particular option is to be used called \"-debug\".\n\nExamples:\n```bash\n$ runnr -debug -out helloworld -param \"-std=c++11\" hello.cpp\nrunnr: debug: config: using config from /Users/aniket/.config/runnr.conf\nrunnr: debug: executed: g++ -std=c++11 -o helloworld hello.cpp\nrunnr: debug: run: ./helloworld\nHello, World\n```\n\nUsing the \"-debug\" gives a detailed output of the underneath commands execution.\n\n- ### Version:\nTo check the version of runnr:\n\n```bash\n$ runnr --version\nv0.x.x\n$ runnr -V\nv0.x.x\n```\n\n- ### Help:\n\n```bash\n$ runnr --help\n$ runnr -h\n```\n\n- ## Update:\nUpdate runnr using `--update or -U` option. It uses pip to update itself.\n```bash\n$ runnr --update\n$ runnr -U\n```\n\n# VERSION:\n- Version rule :: `<major>.<minor>.<patches>`\n>v0.2.1\n\n# What's New in this Update:\n\n1. Added help option \"--help\" or \"-h\".\n2. Added \"--update\" or \"-U\" option to automatically update runnr using pip.\n3. Added option \"-files\" for compiling/interpreting multiple files at once.\n4. Fixed the issue where runnr detects the single argument as file with no extension.\n5. Fixed the issue where runnr ignore cli arguments for interpreted languages.\n6. Removed auto copying of \"runnr.conf\" while building the \"setup.py\".\n7. Removed unnecessary boolean variables from runnr_flags and replaced them with string operations.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "runnr is an open-source command line interface tool for building, compiling & executing different programs & files.",
    "version": "0.2.1",
    "project_urls": {
        "Home Page": "https://github.com/thesmartaniket/runnr"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1b2ad33bc588c982643bbc1350c42474fa462a8082c789c9e813965407fb808c",
                "md5": "c8b02880588007e0e1958faf0494f507",
                "sha256": "995988e8171cd9f736bfebda33eb20e895ab3bfd39b0ac773f18c5437863f842"
            },
            "downloads": -1,
            "filename": "runnr-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c8b02880588007e0e1958faf0494f507",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 10031,
            "upload_time": "2023-10-24T14:25:38",
            "upload_time_iso_8601": "2023-10-24T14:25:38.394184Z",
            "url": "https://files.pythonhosted.org/packages/1b/2a/d33bc588c982643bbc1350c42474fa462a8082c789c9e813965407fb808c/runnr-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e9ac7a82e9a68feb206fe9fbb667073e7e5066c309d1ebb69dd73e86de58f9f5",
                "md5": "a859b114c055459f92246243bb1cabae",
                "sha256": "74de6fb86f0435f29fafe064656972944337cfac436ff7cc8f485c6d806c4506"
            },
            "downloads": -1,
            "filename": "runnr-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a859b114c055459f92246243bb1cabae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 12410,
            "upload_time": "2023-10-24T14:25:40",
            "upload_time_iso_8601": "2023-10-24T14:25:40.122849Z",
            "url": "https://files.pythonhosted.org/packages/e9/ac/7a82e9a68feb206fe9fbb667073e7e5066c309d1ebb69dd73e86de58f9f5/runnr-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-24 14:25:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "thesmartaniket",
    "github_project": "runnr",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "runnr"
}
        
Elapsed time: 0.65940s