0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

オプションのついたg++をPowerShell上で素早く実行する

Posted at

実現したいこと

PowerShell
g+ a.cpp

を実行した際に

PowerShell
g++ -std=c++20 -g -Wall -Wextra -Wshadow -Wfloat-equal -Wno-char-subscripts -ftrapv -fno-omit-frame-pointer -fno-sanitize-recover a.cpp

が実行されるようにg+を定義したいです。

方法

$PROFILE

を実行してPowerShellのプロファイルスクリプトがあるパスを調べます。
そのスクリプトをメモ帳などで開きます。
実行したいコマンドが引数付きなのでfunctionを使って定義します。

Microsoft.PowerShell_profile.ps1
function g+ (){
    g++ -std=c++20 -g -Wall -Wextra -Wshadow -Wfloat-equal -Wno-char-subscripts -ftrapv -fno-omit-frame-pointer -fno-sanitize-recover @args
}

以上です!

参考記事

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?