Package: edl-cr
edl-crA CLI tool to run code. See more athereProject Status:RepositoryDependenciesBuildReleasePackageInstallUsepipto install edl-cr.pipinstalledl-crUsageUse commandecrto run edl-cr.CLI ModeOptionDescription-d --dirSet working directory-c --commandExecute command just like in interactive mode-V --versionShow ecr version-v --verboseEnableDEBUGlevel for loggingInteractive ModeIf you don't use--commandoptions, edl-cr will run in interactive mode.ECR ColorDescriptionEmptyNo ecr data at current and globalYellowLoad from global ecr dataGreenLoad from current ecr dataRedLoad failedInitialize>initInitialize ECR data. It will create a directory named.ecrin current directory.If you want to clear ECR data, use this command:>clearCreate and RunCreate a new code file:>newa.cpp# Create code file with template>newa.cpp-tbaseIt will use code template in.ecr/templates/to create file and set current file with the new file.If you want to set current file with a existed file, use this:>nowa.cppThen useeditto open default editor to edit code:>editThen useruncommand to run code.# run a.cppa.cpp>run# run b.cppa.cpp>runb.cpp# run a.cpp with file input and standard outputa.cpp>run-iofs# watch the file a.cpp and run autoa.cpp>run-wIf you giveinput.dataandstd.datafor input data and standard output data, usetestto run and test output data.# run a.cpp's outputa.cpp>test# run and test b.cpp's outputa.cpp>testb.cpp-r# watch the file a.cpp and run&test autoa.cpp>test-w-rUse DirectoryNot only use files, you can also use directories to create a unique environment for codes.# Create a new directory env>newproject-d# Set a directory env for current>nowproject-d# Run@project>run# Judge@project>testForrunandtestcommands, it will use the command list inconfig.ymlin the directory. You can write your own commands in it. And these command works in the directory of current work-item.test:nullrun:nullFor commands intestandrun, you can use variables as same as inexecutor.ymlandjudger.ymlbelow.Input and OutputThe file input is at.ecr/input.data, and the file output is at.ecr/output.data.The standard output data for judging is at.ecr/std.dataCleanClean the compiling output and something else:>cleanDebugWhen you meet some errors, for example, ecr data loading failing, usedebugcommand to get some information. This is also a useful tool when you create an issue.VariablesYou can use builtin variables just like in bash:>echo$wdirVariableDescriptionwdirWorking directoryedirECR directoryjdirJudger directorytdirTemplate directorycurrentCurrent fileinputInput fileoutputOutput fileconfigConfig fileglobaldirGet global ecr directoryCommandsThese are builtin commands. You can use system command inimportedCommandlist.If you want to call a system command that isn't inimportedCommandlist, use>prefix like>ls.CommandDescriptioninit [-g --globals]Initialize ECR dataclear [-g --globals]Clear ECR datareload [-c --current]Reload ECR data or current work-item datanew [file] [-e --edit] [-d --dir] [-t --template name]Create new code filenow [file] [-d --dir]Change current fileedit [file] [-n --now] [-d --dir]Edit code filerun [file] [-io --io] [-w] [-d --dir]Run code filetest [file] [-r --re] [-w] [-j --judger name] [-d --dir]Judge output datacleanClean temp filespwdPrint working directorycdChange working directoryversionGet versionclsClear consoleexitExit-h --helpGet helpstatus [-v --var]Get statustemplate [new clear remove clear]Template toolsdebug [-os --os] [-c --current] [-e --ecr] [-l --log] [-o file]Show debug dataGlobalWhen ecr starts, it will initialize global data and config at~(if it doesn't exist), and you can useinit -g,clear -gto re-initialize and clear that.TemplateYou can write your own templates for dir-workitem.>templatenewmytempIt will create a new foldermytempat template folder.ecr/templates, and generate config files.The files in directory.templateare the template config files. They will not be copied to destination..template/config.ymlThis file defines the config for the template.# commands to execute after copying files# the commands will be executed with working directory = destinationafter:[]# relative path of the directory to be copied to destination# the base path is the current template pathrootPath:''# template's subjectsubject:testConfigThe config files is at.ecr/config.ymlThis file contains basic config.# The default editordefaultEditor:vim# The default judger's namedefaultJudger:text# The default IO when rundefaultIO:ss# The default shell to execute commanddefaultShell:powershell -c# The default time limit for every step when rundefaultTimeLimit:10# The ecr version for the config fileeVersion:0.0.2# Map name to system commandimportedCommand:bash:bashcat:catcopy:copycp:cp# File extension name to be cleanedtempFileFilter:-exe-o-class-outexecutor.ymlThis file gives the way to run a code file.You can use these varibles in command:fileNameThe code file namefileNameWithoutExtThe code file name without extensionc:-gcc {fileName} -o {fileNameWithoutExt}-./{fileNameWithoutExt}cpp:-g++ {fileName} -o {fileNameWithoutExt}-./{fileNameWithoutExt}judger.ymlThis file gives the way to test.You can use these varibles in command:judgerDirThe directory path for judgers. It will be pointed to$wdir/.ecr/judgersexpectFileThe expect output filerealFileThe real output filetext:# Judger name-python -u {judgerDir}/text.py {expectFile} {realFile}judgers/This directory contains some judgers, you can write your judgers and use them.template.ymlThis file defines the default code template for different language.It only contains the template file name (without extension name), and it will find the file intemplates/The key-value pairdirgives the default template name for directory work-item.templates/This directory contains code templates.DevelopingTheMakefileuseSHELLvarible in Windows (as well asPY), so if you are in Linux, change it before usemake.To build and upload the package, this requires these modules setuptools, wheel, twine. You can trymake prepareto install these modules.Maybe there are some differences between win's command and linux's command, so feel free to modifyMakefilewhen you meet some errors.# Runmakerun

makerunRARG=-h# use command args# Use pylint to checkmakelint# Testmaketest# Test and get coveragemakecover# Buildmakebuild-B# Install locallymakeinstall# Uninstall locallymakeuninstall# Cleanmakeclean# Upload to PyPImakeupload# Upload to TestPyPImakeuptestRequirementsPython 3.7See more