📄 createmodule
字号:
#!/bin/bash[ ! "$1" ] && { echo "makemodule: create a new module in src/" echo "$0 <modulename>" exit 1}[ -e "$1.c" -o -e "$1.c" ] && { echo "module $1 already exists, so I refuse to overwrite it" exit 1}upper=$(echo $1 | tr "[:lower:]" "[:upper:]")cat >$1.h <<-EOT#ifndef __${upper}_H__#define __${upper}_H__// TODO: insert code here#endif /*__${upper}_H__*/EOTcat >$1.c <<-EOT#include "common.h"#include "$1.h"///////////////////////////////////////////////////////////////////////////////int _test_$1(int argc, char *argv[]) { printf("Nothing to test in $1.\n"); return 0;}EOT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -