<p>I want, in one command with <strong>args</strong> to config <code>kubeconfig</code>, that is able to connect to k8s cluster.</p>

<p>I tried the following which does not work.</p>

<pre><code>cfg:
    mkdir ~/.kube

kube: cfg
    touch config $(ARGS)
</code></pre>

<p>In the <strong>args the user</strong> should pass the config file <strong>content</strong> of the cluster (kubeconfig). </p>

<p>If there is a shorter way please let me know.</p>

<p><strong>update</strong></p>

<p>I've used the following which (from the answer) is partially solve the issue.</p>

<pre><code>kube: cfg
    case "$(ARGS)" in \
      ("") printf "Please provide ARGS=/some/path"; exit 1;; \
      (*)  cp "$(ARGS)" /some/where/else;; \
    esac
</code></pre>

<p>The problem  is because of the <code>cfg</code> which is creating the dir in case the user not providing the <code>args</code> and in the <strong>second</strong> run when providing the path the dir is already exist and you get an error, is there a way to avoid it ? <strong>something like if the arg is not provided dont run the cfg</strong></p>

<p>I assume the user input is the pathname of a file. The <code>make</code> utility can take variable assignments as arguments, in the form of <code>make NAME=VALUE</code>. You refer to these in your <code>Makefile</code> as usual, with <code>$(NAME)</code>. So something like</p>

<pre><code>kube: cfg
    case "$(ARGS)" in \
      ("") printf "Please provide ARGS=/some/path"; exit 1;; \
      (*)  cp "$(ARGS)" /some/where/else;; \
    esac
</code></pre>

<p>called with</p>

<pre><code>make ARGS=/some/path/file kube
</code></pre>

<p>would then execute <code>cp /some/path/file /some/where/else</code>. If that is not what you were asking, please rephrase the question, providing exact details of what you want to do.</p>
